mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
24 lines
No EOL
280 B
PHP
24 lines
No EOL
280 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
|