3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class A { private function foo() { print __CLASS__; } } abstract class B extends A { private function foo() { print __CLASS__; } } class C extends B { private function foo() { print __CLASS__; } public function goo() { parent::foo(); a::foo(); } } Closure::bind( fn() => $this->foo(), new C, A::class )();
Output for 8.2.31 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
A
Output for 7.3.15
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')' in /in/EG63I on line 21

preferences:
29.81 ms | 1139 KiB | 8 Q