Careful Stas :), you probably missed the "import foo::bar;" This code
works just fine:

No I didn't. That's the whole point - once you do import outside namespace, you can break stuff inside. Namespace is supposed to be isolated from other namespaces, that's the whole point of it. But if you make import have effects on other namespaces, then code in one namespace can break other.

file1.php:
<?php
namespace foo;
class bar {}
?>

file2.php:
<?php
namespace gronk;
import foo::bar;
class bar {}
?>

The problem is not this code. The problem is this code:

file1.php
<?php
namespace foo;
import otherfoo::bar;
?>

file2.php:
<?php
namespace gronk;

class bar {}
?>

Would start failing too once you merge them in one file, even though they worked just fine before.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

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

Reply via email to