php-src/Zend/tests/traits/bug60217c.phpt

27 lines
534 B
Plaintext
Raw Normal View History

--TEST--
Bug #60217 (Requiring the same method from different traits and abstract methods have to be compatible, in both directions.)
--FILE--
<?php
trait TBroken1 {
public abstract function foo($a, $b = 0);
}
trait TBroken2 {
public abstract function foo($a);
}
class CBroken {
use TBroken1, TBroken2;
public function foo($a) {
echo 'FOO';
}
}
$o = new CBroken;
$o->foo(1);
--EXPECTF--
2012-12-25 06:23:08 +00:00
Fatal error: Declaration of TBroken2::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d