Hi Nikita,

> I've put up an RFC to make the handling of "null" arguments consistent
> between internal and user-defined functions:
> 
> https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg
> 
> I started an informal discussion for this change during the 7.4 cycle
> already, but decided to postpone the change at the time.

Sounds like a good idea - available open source static analyzers are much 
better than they were when php 7.0.0 was released,
and php now has nullable types, union types and property types.

E.g. Phan already warns about passing null/nullable to internal functions as 
strictly as user-defined functions,
partly because I'd assumed internal functions would change in the future.
https://phan.github.io/demo/?code=%3C%3Fphp%0Afunction+test%28%3Fstring+%24str%29+%7B%0A++++return+strlen%28%24str%29+%2B+strlen%28null%29%3B%0A%7D
(10MB webassembly demo)

Regards,
Tyson
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to