Re: [PHP-DEV] make casts more strict in PHP 7

[email protected] (Andrea Faulds)
Newsgroups php.internals
Message-ID <[email protected]>
On 9 Sep 2014, at 20:26, Robert Stoll <[email protected]> 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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.