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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC