Re: Type hinting

From: Date: Wed, 09 Jun 2010 18:15:03 +0000
Subject: Re: Type hinting
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-48714@lists.php.net to get a copy of this message
At 17:54 09/06/2010, Ferenc Kovacs wrote:
If we introduce the E_TYPE what will be the new default/suggested error level? If it won't be "enabled" by default, then maybe we could introduce this in the whole language. I mean, if you implicitly convert '123asd' to integer, you will trigger this error.
That's exactly what I had in mind. Have E_TYPE off by default and implement it throughout PHP - instead of just type hints.
for example: $foo = 0; $foo += (int)'123abc'; // no error $foo += '123abc'; // E_TYPE
Exactly. And to make sure we're on the same page: $foo += '123'; // no error Zeev

« previous php.internals (#48714) next »