Created
July 1, 2014 09:28
-
-
Save ManInTheBox/3f2bf19fa00844e8c468 to your computer and use it in GitHub Desktop.
PHP's instanceof operator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php -r 'var_dump('test' instanceof \Exception);' | |
bool(false) | |
$ php -r 'var_dump(null instanceof \Exception);' | |
Fatal error: instanceof expects an object instance, constant given in Command line code on line 1 | |
$ php -r 'var_dump(1234 instanceof \Exception);' | |
Fatal error: instanceof expects an object instance, constant given in Command line code on line 1 | |
$ php -r 'var_dump(array() instanceof \Exception);' | |
bool(false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment