summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/static_003.phpt
blob: 87f4b77aa81a84973ae95240e4bff4e3f3bd1424 (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