#44653 [Opn->Asn]: Irritating warning concerning non-compound name in use statement.
| From: | dmitry@php.net | Date: | Wed, 09 Apr 2008 07:32:00 +0000 |
| Subject: | #44653 [Opn->Asn]: Irritating warning concerning non-compound name in use statement. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-124102@lists.php.net to get a copy of this message | ||
ID: 44653
Updated by: dmitry@php.net
Reported By: jreich at jreich dot com
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
PHP Version: 5.3CVS-2008-04-06 (snap)
-Assigned To:
+Assigned To: dmiry
Previous Comments:
------------------------------------------------------------------------
[2008-04-06 13:26:00] jreich at jreich dot com
Description:
------------
Using a non-compound name in a use statement results in a warning that
states non-compound names in use statement would have no effect which
isn't true as the following reproduce code shows.
Reproduce code:
---------------
<?php // a.php
namespace Test1;
function fooBar() { echo 'Test1::fooBar()' . PHP_EOL; }
namespace Test2;
use Test1;
Test1::fooBar();
<?php // b.php
namespace Test1;
function fooBar() { echo 'Test1::fooBar()' . PHP_EOL; }
namespace Test2;
Test1::fooBar();
Expected result:
----------------
No warning or same behavior with and without use statement.
Actual result:
--------------
Executing a.php results in "Warning: The use statement with
non-compound
name 'Test1' has no effect in [...]".
Executing b.php results in "Fatal error: Class 'Test2::Test1' not found
in [...]".
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44653&edit=1