3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $from = -2; $to = 6; $segments = 20; $f = function($x) { return ($x ** 2) + (2 * $x) + 3; }; $step = ($to - $from) / $segments; $A = 0; for ($x = $from + ($step / 2); $x < $to; $x += $step) { $A += $f($x) * $step; } echo $A;
based on AW1RA
Output for 5.6.0 - 7.3.0beta1
130.56