Created
June 18, 2012 16:19
-
-
Save stealth35/2949195 to your computer and use it in GitHub Desktop.
Alias weird 2
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 | |
use stdClass as Object; | |
$class1 = 'stdClass'; | |
$class2 = 'Object'; | |
var_dump(new stdClass()); | |
var_dump(new Object()); | |
var_dump(new $class1()); | |
var_dump(new $class2()); | |
/* | |
object(stdClass)#1 (0) { | |
} | |
object(stdClass)#1 (0) { | |
} | |
object(stdClass)#1 (0) { | |
} | |
Fatal error: Class 'Object' not found in test/index.php on line 11 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment