summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/static_003.phpt
blob: 7417083f69c7c840105bcde3bd12142d55e38fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--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