mirror of
https://github.com/php/php-src.git
synced 2024-12-18 22:41:20 +08:00
24 lines
336 B
PHP
24 lines
336 B
PHP
--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
|