3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct(string $a) {} // @phpstan-ignore-line public function bar(string $bar): void {} } (new Foo(...['a' => 'b'])); (new Foo(...['b']))->bar(...['bar' => 'foo']); function foo(string $a, string $c): void { } foo(...['a' => 'b', 'c' => 'd']);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Output for 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Cannot unpack array with string keys in /in/7lTWP:9 Stack trace: #0 {main} thrown in /in/7lTWP on line 9
Process exited with code 255.

preferences:
123.72 ms | 401 KiB | 122 Q