Hi Pierre, > De : Pierre Joye [mailto:pierre....@gmail.com] > > With the other RFC, which changes the casting modes, I wish everyone > good luck. I may be wrong, can happen ;), but we simply do not know > and will not know before 7.0.0 is out. Good luck to change them again > to "adapt and tweak", and good luck to the apps developers to adapt > their apps with plenty of patch versions checks. This is the reason #2 > why I am against your RFC, the #1 being the total lack of actual non > magic casting (read: strict), optionally enabled.
About #1: if, one day, a majority decides that we absolutely need strict types, it will be very easy. Just define four additional type hints, something like 'int!', 'float!', 'string!' 'bool!' or any other syntax. These types would be defined as accepting only their native zval type and, of course, performing no conversion. And that's it. Nothing more. You have your strict types, function by function, argument by argument, return type too if you want. Isn't it nice ? We decided not to propose such types because we think it would bring more bad than good. That's just an opinion. Do you see the difference ? we don't propose strict types for 7.0 but, if you gather a majority favoring it, they may be present in 7.1. About #2: The risk is not so terrible. As the default is to turn off E_DEPRECATED messages in production, it is even very low. The highest risk we take is to see a small performance hit. Probably negligible compared to the phpng positive impact on performance. And temporary because developers will quietly fix their code and the hidden messages will disappear. So, we probably won't have to rely on 'good luck'. FUD apart, every test Dmitry ran using his upcoming patch (which will implement E_DEPRECATED) on existing PHP software raised very few new errors. More : after analysis, all these messages except 1, I believe, correspond to undetected bugs in the PHP code. Like the bug I detected in the PHP code to build phar.phar. So, I can go further : we are not breaking anything *and* we are helping users to find undetected bugs in their codebase. Nice side effect, isn't it ? Regards François -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php