xref: /PHP-8.1/Zend/tests/lsb_023.phpt (revision c1e977f1)
1--TEST--
2Late Static Binding static:: calls protected / public method of child class even then
3the method is private in parent class
4--FILE--
5<?php
6class A {
7    public static function out() {
8        echo static::value(), PHP_EOL;
9    }
10
11    private static function value() { return 'A'; }
12}
13class B extends A {
14    protected static function value() { return 'B'; }
15}
16class C extends A {
17    public static function value() { return 'C'; }
18}
19A::out();
20B::out();
21C::out();
22echo PHP_EOL;
23--EXPECT--
24A
25B
26C
27