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 (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3CVS-2008-04-06 (snap) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jreich at jreich dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 15:01:35 2025 UTC