3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function __construct(final public string $foo) { } } $a = new A('test'); $c = new ReflectionClass($a); foreach ($c->getProperties() as $prop) { var_dump($prop->isFinal()); var_dump($prop->isPromoted()); } var_dump($a->foo);
Output for 8.3.5
Fatal error: Cannot use the final modifier on a parameter in /in/TdZfV on line 5
Process exited with code 255.

preferences:
38.59 ms | 489 KiB | 3 Q