3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=0); error_reporting(0); function foo(int $int): void { echo "[{$int}]"; } try { foo(1_0); foo('2_0'); } catch (TypeError) { echo 'TypeError'; }
Output for 7.4.0 - 7.4.11
Parse error: syntax error, unexpected ')', expecting '|' or variable (T_VARIABLE) in /in/DduJJ on line 11
Process exited with code 255.
Output for 7.3.0 - 7.3.23
Parse error: syntax error, unexpected '_0' (T_STRING), expecting ')' in /in/DduJJ on line 9
Process exited with code 255.
Output for 7.2.0 - 7.2.34
Parse error: syntax error, unexpected '_0' (T_STRING), expecting ',' or ')' in /in/DduJJ on line 9
Process exited with code 255.

preferences:
35.86 ms | 458 KiB | 5 Q