3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function num(int $num){ echo $num; } num(1.0);
based on TtsSg
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to num() must be of the type integer, float given, called in /in/qsRki on line 7 and defined in /in/qsRki:4 Stack trace: #0 /in/qsRki(7): num(1) #1 {main} thrown in /in/qsRki on line 4
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/qsRki on line 2 Catchable fatal error: Argument 1 passed to num() must be an instance of int, double given, called in /in/qsRki on line 7 and defined in /in/qsRki on line 4
Process exited with code 255.