3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function pass_float(float $x) { echo "why?"; } $i = 1; if(gettype($i) == "integer") { pass_float($i); }
based on LFZHJ
Output for 7.0.0 - 7.2.6
why?
Output for 5.3.19 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/EUUs7 on line 2 Catchable fatal error: Argument 1 passed to pass_float() must be an instance of float, integer given, called in /in/EUUs7 on line 10 and defined in /in/EUUs7 on line 4
Process exited with code 255.