3v4l.org

run code in 300+ PHP versions simultaneously
<?php $q_list = array ( 0 => array ( 'id' => '2', 'subject_id' => '1', 'question' => 'Question No One', 'recordstatus' => '1', ), 1 => array ( 'id' => '3', 'subject_id' => '1', 'question' => 'Question No Two', 'recordstatus' => '1', ), 2 => array ( 'id' => '4', 'subject_id' => '1', 'question' => 'Question No Three', 'recordstatus' => '1', ), ); foreach($q_list as $q){ $res[$q['subject_id']][] = $q; } var_dump($res);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [1]=> array(3) { [0]=> array(4) { ["id"]=> string(1) "2" ["subject_id"]=> string(1) "1" ["question"]=> string(15) "Question No One" ["recordstatus"]=> string(1) "1" } [1]=> array(4) { ["id"]=> string(1) "3" ["subject_id"]=> string(1) "1" ["question"]=> string(15) "Question No Two" ["recordstatus"]=> string(1) "1" } [2]=> array(4) { ["id"]=> string(1) "4" ["subject_id"]=> string(1) "1" ["question"]=> string(17) "Question No Three" ["recordstatus"]=> string(1) "1" } } }

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.76 ms | 402 KiB | 8 Q