Nikita Popov wrote on 18/02/2015 00:35:
I don't like the way this is heading with regards to internal functions. Apart from better inter-compatibility, the primary appeal of Andrea's proposal was that we have the option to make not only userland function calls strict, but internal ones as well. With these modifications this is lost for all practical purposes.
I actually rather like this idea - it allows internal functions to gradually introduce scalar type hints just as userland code will gradually introduce them, rather than assuming a new meaning of existing metadata. It gives a chance to look, for each function, what hints make sense, separate from the technical requirements of translating to a strongly typed set of C variables, which is the main role of ZPP.
Note that, however natural it may seem to core/extension devs, the workings of ZPP are not at all obvious to users, so the more similarities between internal and user-defined type hints, the better.
Where "practical purposes" refers to my assumption that it is very unlikely that we'll add arginfo typehints to the entirety of all bundled functions and the added typehints will not be heavily colored by people trying to shove in weak typing even when strict mode is enabled.
I see it working well if a large batch of uncontroversial functions have type hints mechanically added straight away, and then more complex cases are looked at in detail and discussed via pull requests or similar. What you have identified there is a danger to be watched out for, certainly, but it is not an inevitable outcome, if we come up with a decent set of guidelines of how the feature should be used.
Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php