|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-09 08:57 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
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 [...]".