3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct(final public string $id) { } } $a = new A('test'); echo $a->id;
Output for 8.3.5, 8.4.3
Fatal error: Cannot use the final modifier on a parameter in /in/3XL5r on line 5
Process exited with code 255.
Output for 8.2.29
Parse error: syntax error, unexpected token "final", expecting variable in /in/3XL5r on line 5
Process exited with code 255.

preferences:
155.35 ms | 1012 KiB | 7 Q