Created
April 26, 2012 16:46
-
-
Save Majkl578/2500892 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait T | |
{ | |
public function foo(array $x) | |
{ | |
echo __METHOD__; | |
} | |
} | |
class Test | |
{ | |
use T { | |
T::foo as bar; | |
} | |
} | |
class TestSub extends Test | |
{ | |
public function foo() | |
{ | |
echo __METHOD__; | |
} | |
} | |
(new TestSub())->bar([]); // works | |
(new TestSub())->foo(); // Declaration of TestSub::foo() should be compatible with Test::foo(array $x) - but I never declared this one before |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment