3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class DemoFile { final private $x = true; }
Output for 8.5.0 - 8.5.10
Fatal error: Property cannot be both final and private in /in/lhT8c on line 5 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.4.1 - 8.4.25
Fatal error: Property cannot be both final and private in /in/lhT8c on line 5
Process exited with code 255.
Output for 8.3.0 - 8.3.33
Fatal error: Cannot use the final modifier on a property in /in/lhT8c on line 5
Process exited with code 255.
Output for 8.2.31 - 8.2.33
Fatal error: Cannot declare property DemoFile::$x final, the final modifier is allowed only for methods, classes, and class constants in /in/lhT8c on line 5
Process exited with code 255.

preferences:
53.05 ms | 793 KiB | 3 Q