Created
November 7, 2012 12:34
-
-
Save amir/4031362 to your computer and use it in GitHub Desktop.
Stay Classy!
This file contains 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
r2d2➜ /tmp cat foo.php && php foo.php | |
<?php | |
$value = 1; | |
$some_object = new stdClass; | |
var_dump((int)$some_object); | |
var_dump($value == $some_object); | |
</script> | |
========== | |
PHP Notice: Object of class stdClass could not be converted to int in /tmp/foo.php on line 4 | |
int(1) | |
PHP Notice: Object of class stdClass could not be converted to int in /tmp/foo.php on line 5 | |
bool(true) | |
========== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cubny Sorry, just saw your comment.
According to[0] one way of starting a block of PHP code is:
The thing is, you can open a PHP block of code one way, and close it the other way. So
<?php </script>
is valid (hence
==========
is printed as is as the last line).[0] http://www.php.net/manual/en/language.basic-syntax.phpmode.php