Skip to content

Instantly share code, notes, and snippets.

@abrahamvegh
Created June 26, 2013 02:51
Show Gist options
  • Save abrahamvegh/5864397 to your computer and use it in GitHub Desktop.
Save abrahamvegh/5864397 to your computer and use it in GitHub Desktop.
You can't explain that.
<?php
namespace SDM\DB
{
class MySQL
{
public function __construct ()
{
echo 'MySQL->__construct()', "\n";
}
}
}
namespace
{
ini_set('display_errors', 1);
error_reporting(-1);
?>
<pre>
<?php
use SDM\DB;
$db = new MySQL;
}
@abrahamvegh
Copy link
Author

Output:

Fatal error: Class 'MySQL' not found in /path/to/namespaces.php on line 21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment