3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [1100,3150,4430,4430,5170,7450,7450,7450,8230]; $result = []; $previous = 0; foreach ($arr as $value) { $result[$previous += $value] = $value; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 1100 => 1100, 4250 => 3150, 8680 => 4430, 13110 => 4430, 18280 => 5170, 25730 => 7450, 33180 => 7450, 40630 => 7450, 48860 => 8230, )

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