3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function bar(int $foo, int $bar) { return $foo; } try { bar(0.42, 0.42); } catch (TypeError $e) { echo $e->getMessage().PHP_EOL; }
based on j1Lpf
Output for 7.0.0 - 7.2.0
Argument 1 passed to bar() must be of the type integer, float given, called in /in/H2Wg7 on line 9
Output for 5.3.18 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/H2Wg7 on line 2 Catchable fatal error: Argument 1 passed to bar() must be an instance of int, double given, called in /in/H2Wg7 on line 9 and defined in /in/H2Wg7 on line 4
Process exited with code 255.