|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesbug55086.phpt (last revision 2011-07-01 20:33 UTC by pierrick@php.net)55086-v1.diff (last revision 2011-06-30 17:30 UTC by pierrick at webstart dot fr) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-01 16:33 UTC] pierrick@php.net
[2011-07-01 16:49 UTC] bjori@php.net
-Assigned To:
+Assigned To: stef
[2011-07-01 16:51 UTC] bjori@php.net
-Assigned To: stef
+Assigned To: gron
[2011-07-02 13:12 UTC] felipe@php.net
[2011-07-02 13:12 UTC] felipe@php.net
-Status: Assigned
+Status: Closed
[2011-07-02 13:12 UTC] felipe@php.net
[2012-04-18 09:50 UTC] laruence@php.net
[2012-07-24 23:41 UTC] rasmus@php.net
[2013-11-17 09:37 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 03:00:01 2025 UTC |
Description: ------------ Namespace aliases do not work only inside trait's use block. If provide fully qualified namespace then example works fine: class A { use T1, T2 { \N1\T1::hello insteadof \N1\T2; } } Test script: --------------- <?php namespace N1 { trait T1 { public function hello() { return 'hello from t1'; } } trait T2 { public function hello() { return 'hello from t2'; } } } namespace N2 { use N1\T1; use N1\T2; class A { use T1, T2 { T1::hello insteadof T2; } } $a = new A; echo $a->hello(), PHP_EOL; } Expected result: ---------------- hello from t1 Actual result: -------------- PHP Fatal error: Trait 'T1' not found in test_script.php on line 24