Hi internals,

I think you are conentrating on the Exception (and even internal class)
examples a bit too much. Take the following example:

--------
a.php:
<?php

// 1. Some library which does not use namespaces and defines a class Foo
include("b.php");
// 2. Some part of a library using namespaces
include("c.php");
// 3. Some other part of the namespace-using library
include("d.php");
?>
--------
b.php:
<?php
class Foo {
}
?>
--------
c.php:
<?php
namespace Bar;

class Foo {
}
?>
--------
d.php:
<?php
namespace Bar::Other;
import Bar::Foo;
?>
--------

Running this example produces a "Fatal error: Import name 'Foo'
conflicts with defined class in [...]/d.php on line 4". This problem
does not only exist with internal classes (which is bad enough - still
remember DateTime?) but also when some non-namespaced code might be used
  in conjunction.

As using namespaces is about preventing naming collisions having to
assume that some class "Foo" does not exist while developing the library
using namespaces is just inacceptable and makes the namespace
implementation pretty useless.
And if you start arguing that you should not use import in cases where
you don't control the global scope you could pretty much argue not to
use it at all and remove it (which makes namespaces some eye-candy for
very long class names).

best regards

Moritz Bechler

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to