3v4l.org

run code in 500+ PHP versions simultaneously
<?php $myarray = array( array( 0 => 0, 1 => 70, 2 => 19, 3 => 0 ), array( 0 => 0, 1 => 24, 2 => 14 ), array( 0 => 0, 1 => 15, 2 => 11, 3 => 0 ), array( 0 => 0, 1 => 15, 2 => 27, 3 => 0 ) ); foreach($myarray as $k => $values) { if (isset($myarray[$k+1])){ $max = max(sizeof($values), sizeof($myarray[$k+1])); for($i = 0; $i < $max; ++$i) { $result[$k][$i] = (isset($values[$i]) ? $values[$i] : 0) - (isset($myarray[$k+1][$i]) ? $myarray[$k+1][$i] : 0); } } else { $result[$k] = $values; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => 0, 1 => 46, 2 => 5, 3 => 0, ), 1 => array ( 0 => 0, 1 => 9, 2 => 3, 3 => 0, ), 2 => array ( 0 => 0, 1 => 0, 2 => -16, 3 => 0, ), 3 => array ( 0 => 0, 1 => 15, 2 => 27, 3 => 0, ), )

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:
47.91 ms | 1522 KiB | 3 Q