3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php <?php $integers = [1, 99]; $intRes = 0; foreach ($integers as $iValue) { $intRes += $iValue; } $floats = [0.01, 0.99]; $floatRes = 0; foreach ($floats as $fValue) { $floatRes += $fValue; } echo number_format($intRes / 100, 2); echo number_format($floatRes, 2); $array = [0.01, 0.99]; $sum = 0; foreach ($array as $value) { $sum += $value; } echo number_format($value, 2);
based on NIV3c
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '<', expecting end of file in /in/d4gLU on line 4
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected '<' in /in/d4gLU on line 4
Process exited with code 255.