3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $num = array( 2154151, '55454', '.04484787', 'bloadh', '6564.465.654', '5653.54' ); foreach($numbers as $num){ if(!$number = filter_var($num, FILTER_VALIDATE_FLOAT)){ echo "$num is invalid"; }else{ echo "$num is valid"; } } ?>
Output for 5.1.0 - 5.6.38, 7.0.0 - 7.2.11
Notice: Undefined variable: numbers in /in/QfCmd on line 5 Warning: Invalid argument supplied for foreach() in /in/QfCmd on line 5
Output for hhvm-3.22.0
Notice: Undefined variable: numbers in /in/QfCmd on line -1 Warning: Invalid argument supplied for foreach() in /in/QfCmd on line -1
Output for hhvm-3.10.1 - 3.21.3
Notice: Undefined variable: numbers in /in/QfCmd on line 11 Warning: Invalid argument supplied for foreach() in /in/QfCmd on line 11
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/QfCmd on line 5
Output for 4.3.11