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) | |
========== |
@cubny Sorry, just saw your comment.
According to[0] one way of starting a block of PHP code is:
<script language="php">
echo 'some editors (like FrontPage) don\'t
like processing instructions';
</script>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what does "script" tag do?