mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
28 lines
No EOL
391 B
PHP
28 lines
No EOL
391 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
|