Hi! > t think this behavior is inconsistent, and we should consider changing it. > > There are two options, but only one is BC. > > - Let 1 instanceof \stdClass return false, instead of crashing. -> seems BC > - Let $x instanceof \stdClass crash, if $x is not an object. -> BC break.
Neither of those "crashes", one of them returns fatal error, which is a valid option for code that is obviously broken. It would also be a valid option to return false, but since it is a valid outcome either way, I don't think changing anything is necessary. It does not make any real code easier to write (I can't see any legit reason to test numerics for being instance of anything) and does not improve anything but abstract "consistency", which in this case is not useful for anything. -- Stas Malyshev smalys...@gmail.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php