#44653 [NEW]: Irritating warning concerning non-compound name in use statement.

From: Date: Sun, 06 Apr 2008 13:26:00 +0000
Subject: #44653 [NEW]: Irritating warning concerning non-compound name in use statement.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124012@lists.php.net to get a copy of this message
From: jreich at jreich dot com Operating system: PHP version: 5.3CVS-2008-04-06 (snap) PHP Bug Type: Scripting Engine problem Bug description: Irritating warning concerning non-compound name in use statement. 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 bug report at http://bugs.php.net/?id=44653&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44653&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44653&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44653&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44653&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44653&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44653&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44653&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44653&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44653&r=support Expected behavior: http://bugs.php.net/fix.php?id=44653&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44653&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44653&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44653&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44653&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44653&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44653&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44653&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44653&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44653&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44653&r=mysqlcfg

« previous php.bugs (#124012) next »