|  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 (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-04-06 (snap) OS:
Private report: No CVE-ID: None
 [2008-04-06 13:26 UTC] jreich at jreich dot com
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;

<?php // b.php
namespace Test1;
function fooBar() { echo 'Test1::fooBar()' . PHP_EOL; }

namespace Test2;

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 [...]".


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-09 08:57 UTC]
Fixed name resolution for the second case (b.php), however warning for the first case (a.php) is not removed.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 22:05:44 2022 UTC