3v4l.org

run code in 200+ PHP versions simultaneously
<?php function series_sum($n) { $quotient = 1; $divident = 1; $increment_num = 3; $sum = 1; for($i=1; $i<$n; $i++){ $quotient += $increment_num; $sum += ($quotient/($divident)); } return $sum; } echo series_sum(3);
based on UaBS6
Output for 7.2.0 - 7.4.6
12