Re: [PATCH] allowing multiple namespaces per file plus namespaces with brackets

From: Date: Tue, 21 Aug 2007 21:41:26 +0000
Subject: Re: [PATCH] allowing multiple namespaces per file plus namespaces with brackets
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-31817@lists.php.net to get a copy of this message
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 stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#31817) next »