Hi,
Rowan Collins wrote:
On 23 February 2017 09:15:27 GMT+00:00, "Michał" <aaat...@o2.pl> wrote:
And what about situation when someone is forcing
declare(strict_types=1)? I think, it's really a good place to force
proper types. Including nulls.
strict_types controls the behaviour of *calling* functions, but the check here
would have to be when *defining* the function: it would give an error that the
function definition is invalid, like if you say function foo(int $bar='hello')
Unless you had some other behaviour in mind?
In addition to this, if we wanted to prohibit implicit nullability in
parameter definitions, we should have done it when we introduced
declare(strict_types=1); in the first place, and that ship has sailed.
--
Andrea Faulds
https://ajf.me/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php