3v4l.org

run code in 500+ PHP versions simultaneously
<?php // defined before the parent class : no error class y extends x {} abstract class x { abstract function foo(); } // defined after the parent class : error class y2 extends x {} ?>
Output for 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.3
Fatal error: Class y2 contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (x::foo) in /in/mUEsK on line 11
Process exited with code 255.

preferences:
20.87 ms | 1164 KiB | 5 Q