3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { final private function bla() { echo "A::bla()"; } } class B extends A { public function bla() { echo "B::bla()"; } }
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Warning: Private methods cannot be final as they are never overridden by other classes in /in/dP1Gv on line 5
Output for 5.4.18
Fatal error: Cannot override final method A::bla() in /in/dP1Gv on line 17
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
Fatal error: Cannot override final method A::bla() in /in/2hU2X on line 17
Process exited with code 255.

preferences:
100 ms | 402 KiB | 74 Q