php-src/Zend/tests/traits/static_forward_static_call.phpt
Stefan Marr 6ad5c889a1 Added tests to for static support of traits.
# This was not tested and documented yet.
# Updated documentation in the RFC http://wiki.php.net/rfc/horizontalreuse
2010-11-17 23:05:20 +00:00

28 lines
418 B
PHP

--TEST--
Traits and forward_static_call().
--CREDITS--
Simas Toleikis simast@gmail.com
--FILE--
<?php
trait TestTrait {
public static function test() {
return 'Forwarded '.forward_static_call(array('A', 'test'));
}
}
class A {
public static function test() {
return "Test A";
}
}
class B extends A {
use TestTrait;
}
echo B::test();
?>
--EXPECT--
Forwarded Test A