mirror of
https://github.com/php/php-src.git
synced 2024-09-24 19:37:26 +00:00
6ad5c889a1
# This was not tested and documented yet. # Updated documentation in the RFC http://wiki.php.net/rfc/horizontalreuse
24 lines
303 B
PHP
24 lines
303 B
PHP
--TEST--
|
|
Traits and get_called_class().
|
|
--CREDITS--
|
|
Simas Toleikis simast@gmail.com
|
|
--FILE--
|
|
<?php
|
|
|
|
trait TestTrait {
|
|
public static function test() {
|
|
return get_called_class();
|
|
}
|
|
}
|
|
|
|
class A {
|
|
use TestTrait;
|
|
}
|
|
|
|
class B extends A { }
|
|
|
|
echo B::test();
|
|
|
|
?>
|
|
--EXPECT--
|
|
B
|