Skip to content

Instantly share code, notes, and snippets.

@stealth35
Created June 18, 2012 16:19
Show Gist options
  • Save stealth35/2949195 to your computer and use it in GitHub Desktop.
Save stealth35/2949195 to your computer and use it in GitHub Desktop.
Alias weird 2
<?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