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

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

Reply via email to