3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0.25, 0.1667, 0.1667, 0.1667, 0.125, 0.125] ; $res = array_reduce($array, function($carry, $item) { $carry[] = $item + end($carry); return $carry; }, []); print_r($res);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 0.25 [1] => 0.4167 [2] => 0.5834 [3] => 0.7501 [4] => 0.8751 [5] => 1.0001 )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
65.03 ms | 401 KiB | 8 Q