Re: make casts more strict in PHP 7
| From: | Stas Malyshev | Date: | Tue, 09 Sep 2014 23:30:50 +0000 |
| Subject: | Re: make casts more strict in PHP 7 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77123@lists.php.net to get a copy of this message | ||
Hi!
> No, no it would not. PHP’s explicit casts cannot fail, and there is
> absolutely no good reason to change this. If people want strict
> casting, we can add new functions or operators for that specifically.
> But to break explicit casts and make them sometimes fail would cause
> innumerable bugs and backwards-compatibility ideas.
I agree. If the developer explicitly states they want conversion, it
should be conversion. For implicit casts, some tightening may be ok, but
for explicit ones I think it would bring much more headaches than it's
worth.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/