mirror of
https://github.com/php/php-src.git
synced 2024-12-18 22:41:20 +08:00
28 lines
419 B
PHP
28 lines
419 B
PHP
--TEST--
|
|
Traits with late static bindings.
|
|
--CREDITS--
|
|
Simas Toleikis simast@gmail.com
|
|
--FILE--
|
|
<?php
|
|
|
|
trait TestTrait {
|
|
public static function test() {
|
|
return static::$test;
|
|
}
|
|
}
|
|
|
|
class A {
|
|
use TestTrait;
|
|
protected static $test = "Test A";
|
|
}
|
|
|
|
class B extends A {
|
|
protected static $test = "Test B";
|
|
}
|
|
|
|
echo B::test();
|
|
|
|
?>
|
|
--EXPECT--
|
|
Test B
|