3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '2015-09-23' => [ 'user' => [13, 12], 'count' => [ 'count' => 2, 'total' => 2, ], ], '2015-09-24' => [ 'user' => [14], 'count' => [ 'count' => 1, 'total' => 1, ], ], '2015-09-25' => [ 'user' => [15], 'count' => [ 'count' => 1, 'total' => 1, ], ], '2015-09-26' => [ 'user' => [16], 'count' => [ 'count' => 1, 'total' => 1, ], ], '2015-09-27' => [ 'user' => [17, 18], 'count' => [ 'count' => 2, 'total' => 2, ], ], '2015-09-28' => [ 'user' => [19, 20, 21, 22, 23, 24, 25, 26, 27, 28], 'count' => [ 'count' => 10, 'total' => 10, ], ], ]; $total = 0; foreach ($array as ['count' => ['count' => $c, 'total' => &$t]]) { $total += $c; $t = $total; } var_export($array);
Output for git.master, git.master_jit, rfc.property-hooks
array ( '2015-09-23' => array ( 'user' => array ( 0 => 13, 1 => 12, ), 'count' => array ( 'count' => 2, 'total' => 2, ), ), '2015-09-24' => array ( 'user' => array ( 0 => 14, ), 'count' => array ( 'count' => 1, 'total' => 3, ), ), '2015-09-25' => array ( 'user' => array ( 0 => 15, ), 'count' => array ( 'count' => 1, 'total' => 4, ), ), '2015-09-26' => array ( 'user' => array ( 0 => 16, ), 'count' => array ( 'count' => 1, 'total' => 5, ), ), '2015-09-27' => array ( 'user' => array ( 0 => 17, 1 => 18, ), 'count' => array ( 'count' => 2, 'total' => 7, ), ), '2015-09-28' => array ( 'user' => array ( 0 => 19, 1 => 20, 2 => 21, 3 => 22, 4 => 23, 5 => 24, 6 => 25, 7 => 26, 8 => 27, 9 => 28, ), 'count' => array ( 'count' => 10, 'total' => 17, ), ), )

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:
37.41 ms | 403 KiB | 8 Q