Re: make casts more strict in PHP 7
| From: | Andrea Faulds | Date: | Tue, 09 Sep 2014 20:19:21 +0000 |
| Subject: | Re: make casts more strict in PHP 7 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77119@lists.php.net to get a copy of this message | ||
On 9 Sep 2014, at 20:26, Robert Stoll <php@tutteli.ch> wrote:
> Personally, I do not like such inconsistencies either but I like that the
> conversion rules in Andrea's RFC are more strict. And thus I was asking
> myself if it would not make sense to change the current behaviour of
> castings and make them more strict in PHP 7.
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.
--
Andrea Faulds
http://ajf.me/