php-src/Zend/tests/traits/language009.phpt
Stefan Marr e14354af21 Fixed Bug #55554 (Legacy constructors not handled properly) [TRAITS] [DOC]
# The handling of legacy constructors defined by traits was corrected.
# They are now properly registered and used on instantiation.
# The situation for conflicting legacy and __construct constructors is
# mostly identical. If they are defined in the class, they override conflicts
# and do not collide. However, in case different styles are mixed, between
# class and trait definition, we assume a programmer's mistake and report
# a collision.
#
# BTW: +1 for all the fixed tests! `make test` is fun again.
2011-10-09 11:13:27 +00:00

36 lines
427 B
PHP

--TEST--
In instead definitions all trait whose methods are meant to be hidden can be listed.
--FILE--
<?php
error_reporting(E_ALL);
trait A {
public function foo() {
echo 'a';
}
}
trait B {
public function foo() {
echo 'b';
}
}
trait C {
public function foo() {
echo 'c';
}
}
class MyClass {
use C, A, B {
B::foo insteadof A, C;
}
}
$t = new MyClass;
$t->foo();
?>
--EXPECTF--
b