3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array("100","200","350"); $b = 400; // Is not a array is the finding value; $left = $b; $new_array = []; for($i=0;$i<count($a);$i++) { $new_value[] = max($a[$i]-$left, 0); $left = max($left - $a[$i], 0); } var_dump($new_value);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> int(0) [1]=> int(0) [2]=> int(250) }

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:
42.24 ms | 401 KiB | 8 Q