On 10.12.2017 at 12:05, Niklas Keller wrote:

>> This.  There's nothing undefinable about "1 instanceof \stdClass", the
>> clear and obvious answer is: "No, it's not an instance of \stdClass,
>> it's an integer."  The runtime result of false makes sense, the
>> compile time error doesn't.  Let's relax the compile time error (fold
>> it into a const false if you truly must) and call it done.  There's no
>> need to be hostile to users just because the code *seems* silly.
> 
> This code doesn't just *seem* silly. For everything but testing whether it
> works it is totally useless.
> 
> But we might turn the fatal error into a warning like we do it for "use" in
> the global namespace: https://3v4l.org/ph7KW

I fail to see why

  1 instanceof \stdClass

should be handled differently than

  1 === (new stdClass)

for instance.

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to