Bug #64279 [Opn->Fbk]: Using traits aliasing other traitmethods broken
Edit report at https://bugs.php.net/bug.php?id=64279&edit=1
ID: 64279
Updated by: laruence@php.net
Reported by: r dot wilczek at web-appz dot de
Summary: Using traits aliasing other traitmethods broken
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Linux x86_64
PHP Version: 5.4.12
Block user comment: N
Private report: N
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.4-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
seems the fix didn't goto 5.4.12
Previous Comments:
------------------------------------------------------------------------
[2013-02-22 15:28:15] r dot wilczek at web-appz dot de
Description:
------------
It is no longer possible to use a trait, which uses another trait and aliases methods.
This worked in PHP 5.4.10, but changed in either PHP 5.4.11 or PHP 5.4.12.
Test script:
---------------
<?php
trait MyTrait
{
public function foo() {}
}
trait MyOtherTrait
{
use MyTrait
{
foo as bar;
}
}
class Importer
{
use MyOtherTrait;
}
echo 'works' . PHP_EOL;
Expected result:
----------------
works
Actual result:
--------------
Fatal error: Trait method foo has not been applied, because there are collisions with other trait
methods on Importer in Example.php on line 18
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64279&edit=1
Thread (5 messages)