3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tests = [ 71 => 72, 33.1 => 34, 20.8 => 22]; foreach($tests as $test => $expected) { $num = ceil($test); if($num % 2 == 1) $num++; echo "Expected: $expected, Actual: $num\n"; }
Output for 5.4.10 - 7.2.0
Expected: 72, Actual: 72 Expected: 34, Actual: 34 Expected: 22, Actual: 20
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/9YBm9 on line 3
Process exited with code 255.