3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); function test(int $a, int $i = null): void { if ($i === NULL) print("error\n"); else var_dump($i); } test(1, null); test(2, 32); test(3);
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Deprecated: test(): Implicitly marking parameter $i as nullable is deprecated, the explicit nullable type must be used instead in /in/utCc3 on line 5 error int(32) error
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
error int(32) error

preferences:
86.82 ms | 1102 KiB | 4 Q