Skip to content

Instantly share code, notes, and snippets.

@Majkl578
Created April 26, 2012 16:46
Show Gist options
  • Save Majkl578/2500892 to your computer and use it in GitHub Desktop.
Save Majkl578/2500892 to your computer and use it in GitHub Desktop.
<?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