Bug #55086 [Asn->Csd]: Namespace alias does not work inside trait's use block
| From: | felipe@php.net | Date: | Sat, 02 Jul 2011 17:12:55 +0000 |
| Subject: | Bug #55086 [Asn->Csd]: Namespace alias does not work inside trait's use block | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-161503@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55086&edit=1
ID: 55086
Updated by: felipe@php.net
Reported by: andrey dot garbuz at gmail dot com
Summary: Namespace alias does not work inside trait's use
block
-Status: Assigned
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Fedora 14
PHP Version: 5.4SVN-2011-06-30 (SVN)
Assigned To: gron
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Thanks for the patch!
Previous Comments:
------------------------------------------------------------------------
[2011-07-02 13:12:21] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=312817
Log: - Fixed bug #55086 (Namespace alias does not work inside trait's use block)
patch by: Pierrick
------------------------------------------------------------------------
[2011-07-01 16:33:03] pierrick@php.net
The following patch has been added/updated:
Patch Name: bug55086.phpt
Revision: 1309552383
URL: https://bugs.php.net/patch-display.php?bug=55086&patch=bug55086.phpt&revision=1309552383
------------------------------------------------------------------------
[2011-06-30 07:47:02] andrey dot garbuz at gmail dot com
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55086&edit=1