mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
6ad5c889a1
# This was not tested and documented yet. # Updated documentation in the RFC http://wiki.php.net/rfc/horizontalreuse
28 lines
418 B
PHP
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
|