Skip to content

Instantly share code, notes, and snippets.

@fivestar
Created July 15, 2010 08:24
Show Gist options
  • Save fivestar/476659 to your computer and use it in GitHub Desktop.
Save fivestar/476659 to your computer and use it in GitHub Desktop.
<?php
namespace bar;
class Test {}
<?php
namespace foo;
use bar\Test;
class AnotherTest {}
<?php
namespace foo;
class Test {}
<?php
require './foo_Test.php'; // これを"foo_AnotherTest.php"より「先に」読み込むとエラーになる
require './bar_Test.php';
require './foo_AnotherTest.php';
// PHP Fatal error: Cannot use bar\Test as Test because the name is already in use in /home/fivestar/phpfuck/foo/AnotherTest.php on line 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment