xref: /PHP-8.0/Zend/tests/lsb_016.phpt (revision a555cc0b)
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--EXPECT--
37TestChild
38TestChild
39TestChild
40