3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct(private ?string $name = null, private ?string $tag = null, private int $amount) {} } //new Foo(name: 'bar', amount: 123); new Foo('bar', 'tag', 123);
Output for 8.0.0 - 8.0.3
Output for 7.3.0 - 7.3.28, 7.4.0 - 7.4.16
Parse error: syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in /in/AYo0g on line 4
Process exited with code 255.

preferences:
26.5 ms | 457 KiB | 5 Q