mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
23 lines
312 B
Plaintext
23 lines
312 B
Plaintext
|
--TEST--
|
||
|
Traits with static methods referenced using variable.
|
||
|
--CREDITS--
|
||
|
Simas Toleikis simast@gmail.com
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
trait TestTrait {
|
||
|
public static function test() {
|
||
|
return 'Test';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class A {
|
||
|
use TestTrait;
|
||
|
}
|
||
|
|
||
|
$class = "A";
|
||
|
echo $class::test();
|
||
|
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
Test
|