3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $_rows = array(); $_row = array(); for($i = 1; $i <= 28; $i++) { if(in_array($i, array(1,2))) { $_row['row1'][] = 'Category '.$i; } if(in_array($i, array(3,4,5))) { $_row['row2'][] = 'Category '.$i; } if(in_array($i, array(6,7,8))) { $_row['row3'][] = 'Category '.$i; } if(in_array($i, array(9,10,11))) { $_row['row4'][] = 'Category '.$i; } if(in_array($i, array(12,13))) { $_row['row5'][] = 'Category '.$i; } if(in_array($i, array(14,15,16))) { $_row['row6'][] = 'Category '.$i; } if(in_array($i, array(17,18,19))) { $_row['row7'][] = 'Category '.$i; } if(in_array($i, array(20,21,22))) { $_row['row8'][] = 'Category '.$i; } if(in_array($i, array(23,24,25))) { $_row['row9'][] = 'Category '.$i; } if(in_array($i, array(26,27,28))) { $_row['row10'][] = 'Category '.$i; } $_rows[] = $_row; } print_r($_rows);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [row1] => Array ( [0] => Category 1 ) ) [1] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) ) [2] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 ) ) [3] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 ) ) [4] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) ) [5] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 ) ) [6] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 ) ) [7] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) ) [8] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 ) ) [9] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 ) ) [10] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) ) [11] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 ) ) [12] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) ) [13] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 ) ) [14] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 ) ) [15] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) ) [16] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 ) ) [17] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 ) ) [18] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) ) [19] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 ) ) [20] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 ) ) [21] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 [2] => Category 22 ) ) [22] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 [2] => Category 22 ) [row9] => Array ( [0] => Category 23 ) ) [23] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 [2] => Category 22 ) [row9] => Array ( [0] => Category 23 [1] => Category 24 ) ) [24] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 [2] => Category 22 ) [row9] => Array ( [0] => Category 23 [1] => Category 24 [2] => Category 25 ) ) [25] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 [2] => Category 22 ) [row9] => Array ( [0] => Category 23 [1] => Category 24 [2] => Category 25 ) [row10] => Array ( [0] => Category 26 ) ) [26] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 [2] => Category 22 ) [row9] => Array ( [0] => Category 23 [1] => Category 24 [2] => Category 25 ) [row10] => Array ( [0] => Category 26 [1] => Category 27 ) ) [27] => Array ( [row1] => Array ( [0] => Category 1 [1] => Category 2 ) [row2] => Array ( [0] => Category 3 [1] => Category 4 [2] => Category 5 ) [row3] => Array ( [0] => Category 6 [1] => Category 7 [2] => Category 8 ) [row4] => Array ( [0] => Category 9 [1] => Category 10 [2] => Category 11 ) [row5] => Array ( [0] => Category 12 [1] => Category 13 ) [row6] => Array ( [0] => Category 14 [1] => Category 15 [2] => Category 16 ) [row7] => Array ( [0] => Category 17 [1] => Category 18 [2] => Category 19 ) [row8] => Array ( [0] => Category 20 [1] => Category 21 [2] => Category 22 ) [row9] => Array ( [0] => Category 23 [1] => Category 24 [2] => Category 25 ) [row10] => Array ( [0] => Category 26 [1] => Category 27 [2] => Category 28 ) ) )
Output for hhvm-3.10.0

Process exited with code 153.