php-src/Zend/tests/traits/bug60217b.phpt
Stefan Marr 12cf1b7978 Fixed Bug #60217 (Requiring the same method from different traits)
- also added test to check for inconsistent abstract method definitions, they need to be compatible
2011-11-05 01:46:40 +00:00

27 lines
513 B
PHP

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