3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => 0, 1 => 0.25, 2 => 0.75, 3 => 0.5, 4 => 0.5, 5 => 0.75 ]; $finalArray = []; foreach($array as $key=>$arr){ $finalArray[] = ($key > 0) ? array_sum(array_slice($array,$key)) : array_sum($array); } print_r($finalArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 2.75 [1] => 2.75 [2] => 2.5 [3] => 1.75 [4] => 1.25 [5] => 0.75 )

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:
35.91 ms | 405 KiB | 5 Q