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