3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php #declare(strict_types=1); function a(int $num) { return $num; } $n = 3.0; var_dump((float)$n); var_dump(a($n));
based on a4Dm8
Output for hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0alpha1
float(3) int(3)
Output for 5.6.0 - 5.6.30
float(3) Catchable fatal error: Argument 1 passed to a() must be an instance of int, double given, called in /in/2Sbe2 on line 9 and defined in /in/2Sbe2 on line 4
Process exited with code 255.