|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-04-02 19:06 UTC] felipe@php.net
-Status: Open
+Status: Bogus
-Type: Bug
+Type: Feature/Change Request
[2011-04-02 19:06 UTC] felipe@php.net
[2011-04-02 20:11 UTC] michal dot brzuchalski at gmail dot com
[2011-04-02 20:20 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 21:00:02 2025 UTC |
Description: ------------ In use statement we can use "," to separate aliased namespaces but the alias only affect to the last one declared use namespace. It'll be logical to use all declared namespaces in alias and use classes/constants/closures/etc. from aliased namespace where they exists. Test script: --------------- <? namespace A; class test1 {} class test2 {} namespace B; class test1 {} use A, B as Foo; $test1 = new Foo\test1; echo get_class($test1). "\n"; $test2 = new Foo\test2; echo get_class($test2). "\n"; Expected result: ---------------- B\test1 A\test2 Actual result: -------------- B\test1 PHP Fatal error: Class 'B\test2' not found in test.php on line 13