mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +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
|