3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aData = Array ( 'break' => Array ( 'Indoor room' => 42, 'Gym Class' => 19 ), 'finish' => Array ( 'Indoor room' => 42, 'Gym Class' => 19 ), 'lunch' => Array ( 'Indoor room' => 7 ), 'period1' => Array ( 'Indoor room' => 12, 'Gym Class' => 22 ), 'period2' => Array ( 'Gym Class' => 14, 'Indoor room' => 25 ), 'period3' => Array ( 'Gym Class' => 21, 'Indoor room' => 11 ), 'period4' => Array ( 'Gym Class' => 22, 'Indoor room' => 20 ), 'period5' => Array ( 'Gym Class' => 16, 'Indoor room' => 9 ) ); $arraySort = [ "break", "period1", "period2", "period3", "lunch", "period4", "period5", "period6", "finish" ]; $final_array = []; foreach($arraySort as $arraySo){ $final_array[$arraySo] = isset($aData[$arraySo]) ? $aData[$arraySo] : []; } print_r($final_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/4LXvS
function name:  (null)
number of ops:  19
compiled vars:  !0 = $aData, !1 = $arraySort, !2 = $final_array, !3 = $arraySo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   53     1        ASSIGN                                                   !1, <array>
   65     2        ASSIGN                                                   !2, <array>
   67     3      > FE_RESET_R                                       $7      !1, ->14
          4    > > FE_FETCH_R                                               $7, !3, ->14
   68     5    >   ISSET_ISEMPTY_DIM_OBJ                         0          !0, !3
          6      > JMPZ                                                     ~9, ->10
          7    >   FETCH_DIM_R                                      ~10     !0, !3
          8        QM_ASSIGN                                        ~11     ~10
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~11     <array>
         11    >   ASSIGN_DIM                                               !2, !3
         12        OP_DATA                                                  ~11
   67    13      > JMP                                                      ->4
         14    >   FE_FREE                                                  $7
   71    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.59 ms | 997 KiB | 14 Q