Created
February 20, 2012 15:08
-
-
Save Ibmurai/1869598 to your computer and use it in GitHub Desktop.
php unnamed variable and silly stdClass casting
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
<?php | |
$lol = null; | |
$$lol->enabled = true; | |
var_dump($$lol); | |
var_dump($lol); | |
/* Output: | |
PHP Strict Standards: Creating default object from empty value in /Users/ibmurai/lol.php on line 4 | |
Strict Standards: Creating default object from empty value in /Users/ibmurai/lol.php on line 4 | |
object(stdClass)#1 (1) { | |
["enabled"]=> | |
bool(true) | |
} | |
NULL | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment