xref: /PHP-7.1/Zend/tests/lsb_016.phpt (revision 166266df)
1--TEST--
2ZE2 Late Static Binding within hooks/magic methods
3--FILE--
4<?php
5
6class TestChild extends TestParent {
7
8    public static function who() {
9        echo __CLASS__."\n";
10    }
11}
12
13class TestParent {
14
15    public function __get($var) {
16        static::who();
17    }
18
19    public function __set($var, $val) {
20        static::who();
21    }
22
23    public function __call($name, $args) {
24        static::who();
25    }
26
27    public static function who() {
28        echo __CLASS__."\n";
29    }
30}
31$o = new TestChild;
32$o->test();
33$o->a = "b";
34echo $o->a;
35?>
36==DONE==
37--EXPECTF--
38TestChild
39TestChild
40TestChild
41==DONE==
42