3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["user", "date", "md5", "sha1"], ["user1", "02/02/15", "123456", "54321"], ["user1", "02/03/15", "123456", "54321"], ["user2", "02/02/15", "112233", "332211"], ["user2", "02/03/15", "112244", "332244"] ]; $result = []; foreach ($array as [$user, $date, $md5, $sha1]) { $result[$user][$date] = [$md5, $sha1]; } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'user' => array ( 'date' => array ( 0 => 'md5', 1 => 'sha1', ), ), 'user1' => array ( '02/02/15' => array ( 0 => '123456', 1 => '54321', ), '02/03/15' => array ( 0 => '123456', 1 => '54321', ), ), 'user2' => array ( '02/02/15' => array ( 0 => '112233', 1 => '332211', ), '02/03/15' => array ( 0 => '112244', 1 => '332244', ), ), )

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:
32.72 ms | 402 KiB | 8 Q