3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Point { final public function foo(): string { return 'foo'; } } final class PointChildren extends Point { public function foo(): string { return 'children'; } } $children = new PointChildren(); $children->foo();
Output for 7.4.0 - 7.4.28, 8.0.1 - 8.0.16, 8.1.0 - 8.1.3, 8.3.5
Fatal error: Cannot override final method Point::foo() in /in/T6skX on line 13
Process exited with code 255.

preferences:
55.69 ms | 685 KiB | 3 Q