Skip to content

Instantly share code, notes, and snippets.

@wandersonwhcr
Created August 11, 2016 18:55
Show Gist options
  • Select an option

  • Save wandersonwhcr/e16e9dcfb2c54dafa2f84c145b0de983 to your computer and use it in GitHub Desktop.

Select an option

Save wandersonwhcr/e16e9dcfb2c54dafa2f84c145b0de983 to your computer and use it in GitHub Desktop.
Namespace Bug?
<?php
namespace One
{
class Foo
{
}
}
namespace Two
{
class Foo
{
}
}
namespace Two
{
use One\Foo;
class Bar extends Foo
{
}
}
@wandersonwhcr

Copy link
Copy Markdown
Author

PHP Fatal error: Cannot use One\Foo as Foo because the name is already in use in namespace-bug.php on line 19

@mrclay

mrclay commented May 7, 2017

Copy link
Copy Markdown

Clearer demonstration, thanks.

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