Edit report at https://bugs.php.net/bug.php?id=64235&edit=1
ID: 64235
Updated by: reeze@php.net
Reported by: imenem at inox dot ru
Summary: Insteadof not work for class method in 5.4.11
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Debian GNU/Linux
PHP Version: 5.4.11
-Assigned To:
+Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Hi dmitry,
will you take a look please.
Previous Comments:
------------------------------------------------------------------------
[2013-02-18 11:58:23] imenem at inox dot ru
Description:
------------
In PHP 5.4.4 test script works as expected, in 5.4.11 script caused fatal error.
Test script:
---------------
<?php
class TestParentClass
{
public function method()
{
print_r('Parent method');
print "\n";
}
}
trait TestTrait
{
public function method()
{
print_r('Trait method');
print "\n";
}
}
class TestChildClass extends TestParentClass
{
use TestTrait
{
TestTrait::method as methodAlias;
TestParentClass::method insteadof TestTrait;
}
}
(new TestChildClass)->method();
(new TestChildClass)->methodAlias();
Expected result:
----------------
Parent method
Trait method
Actual result:
--------------
Fatal error: Trait TestParentClass is not used in test.php on line 28
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64235&edit=1