Description:
------------
PHP produces unnecessary "Fatal error: Cannot use Something\Foo as Foo because the name is already in use in bar.php". There is no reason to throw such error.
The error is insidious because it dependents on the order in which the files are loaded, which is (with autoloading) unpredictable. In reverse order (see demo-ok.php) is everything ok.
Moreover, in PHP 7 it is not possible to catch this error via try ... catch or even via set_exception_handler().
Test script:
---------------
foo.php:
<?php
namespace A;
class Foo
{}
?>
------------
bar.php:
<?php
namespace A;
use Something\Foo;
?>
-------------
demo-fatalerror.php
<?php
include 'foo.php';
include 'bar.php';
?>
-------------
demo-ok.php
<?php
include 'bar.php';
include 'foo.php';
?>