Re: namespace implementation (irritating warning and autoload)
| From: | Greg Beaver | Date: | Sun, 06 Apr 2008 12:49:06 +0000 |
| Subject: | Re: namespace implementation (irritating warning and autoload) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36818@lists.php.net to get a copy of this message | ||
Julian Reich wrote:
Hi, I recently started porting an application to PHP 5.3. 1. While testing the new namespace implementation I noticed the following: <?php namespace Test1; function fooBar() { echo 'Test1::fooBar()' . PHP_EOL; } namespace Test2; use Test1; Test1::fooBar(); Executing the code above results in a warning: "The use statement with non-compound name 'Test1' has no effect in [...]". I understand the rationale behind this warning but it simply isn't true: omitting the use statement results in a fatal error: "Class 'Test2::Test1' not found in [...]". Since the following code executes without warning or error I think the code above (without use statement) should also execute just fine. <?php namespace Test1::Test2; function fooBar() { echo 'Test1::Test2::fooBar()' . PHP_EOL; } namespace Test3; Test1::Test2::fooBar();This is a clear bug, please report it at bugs.php.net Greg