php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44653 Irritating warning concerning non-compound name in use statement.
Submitted: 2008-04-06 13:26 UTC Modified: 2008-04-09 08:57 UTC
From: jreich at jreich dot com Assigned: dmiry
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-04-06 (snap) OS:
Private report: No CVE-ID:
 [2008-04-06 13:26 UTC] 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 [...]".





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-09 08:57 UTC] dmitry@php.net
Fixed name resolution for the second case (b.php), however warning for the first case (a.php) is not removed.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC