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