xref: /PHP-8.2/Zend/tests/lsb_005.phpt (revision f8d79582)
1--TEST--
2ZE2 Late Static Binding stacking static calleds
3--FILE--
4<?php
5
6class TestA {
7    public static function test() {
8        echo get_class(new static()) . "\n";
9        TestB::test();
10        echo get_class(new static()) . "\n";
11        TestC::test();
12        echo get_class(new static()) . "\n";
13        TestBB::test();
14        echo get_class(new static()) . "\n";
15    }
16}
17
18class TestB {
19    public static function test() {
20        echo get_class(new static()) . "\n";
21        TestC::test();
22        echo get_class(new static()) . "\n";
23    }
24}
25
26class TestC {
27    public static function test() {
28        echo get_class(new static()) . "\n";
29    }
30}
31
32class TestBB extends TestB {
33}
34
35TestA::test();
36
37?>
38--EXPECT--
39TestA
40TestB
41TestC
42TestB
43TestA
44TestC
45TestA
46TestBB
47TestC
48TestBB
49TestA
50