3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function bar(int $a): void; } class Baz implements Foo { public function bar(int $a, int $b=2): void { echo "$a: $b"; } } (new Baz)->bar(1,3);
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.21, 8.4.1 - 8.4.7
1: 3

preferences:
53.48 ms | 406 KiB | 5 Q