3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ [ 'id' => '7ac648ce-18aa-11e9-b673-005056be36b2', 'answer' => '1', 'id_question' => '39', 'pi' => 'very good', 'ca' => NULL, 'pic' => NULL, 'new_deadline' => NULL, 'reason' => NULL, 'notes' => NULL, 'deadline' => NULL ], [ 'id' => '8653ef3d-18aa-11e9-b673-005056be36b2', 'answer' => '3', 'id_question' => '40', 'pi' => 'no problem', 'ca' => NULL, 'pic' => NULL, 'new_deadline' => NULL, 'reason' => NULL, 'notes' => NULL, 'deadline' => NULL ] ]; $array2 = [ [ 'id' => '38', 'question' => 'Kebersihan Meja Counter dan Meja Fincoy ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '39', 'question' => 'Seragam Sales Counter / Salesman* ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '40', 'question' => 'Kerapihan Sales Counter', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '42', 'question' => 'Sales Guide', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '43', 'question' => 'Product Card', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '44', 'question' => 'Ketersediaan Buku Tamu', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '45', 'question' => 'Ketersediaan Price List', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '46', 'question' => 'Ketersedian Rak Brosur ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '47', 'question' => 'Ketersediaan Flyer*/brosur ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ] ]; foreach ($array1 as $row) { $result[$row['id_question']]['id'] = $row['id']; $result[$row['id_question']]['id_question'] = $row['id_question']; $result[$row['id_question']]['type'] = null; $result[$row['id_question']]['answer'] = $row['answer']; $result[$row['id_question']]['pi'] = $row['pi']; $result[$row['id_question']]['ca'] = $row['ca']; $result[$row['id_question']]['pic'] = $row['pic']; $result[$row['id_question']]['deadline'] = $row['deadline']; $result[$row['id_question']]['new_deadline'] = $row['new_deadline']; $result[$row['id_question']]['reason'] = $row['reason']; $result[$row['id_question']]['notes'] = $row['notes']; $result[$row['id_question']]['last_root'] = null; $result[$row['id_question']]['exist_good'] = null; $result[$row['id_question']]['exist_not_good'] = null; $result[$row['id_question']]['not_exist'] = null; $result[$row['id_question']]['n_a'] = null; } foreach ($array2 as $row) { if (isset($result[$row['id']])) { // default elements already declared, just overwrite the nulls // $row['question'] is omitted from data $result[$row['id']]['type'] = $row['type']; $result[$row['id']]['last_root'] = $row['last_root']; $result[$row['id']]['exist_good'] = $row['exist_good']; $result[$row['id']]['exist_not_good'] = $row['exist_not_good']; $result[$row['id']]['not_exist'] = $row['not_exist']; $result[$row['id']]['n_a'] = $row['n_a']; } else { $result[$row['id']]['id'] = $row['question']; // no id, so use question $result[$row['id']]['id_question'] = null; $result[$row['id']]['type'] = $row['type']; $result[$row['id']]['answer'] = null; $result[$row['id']]['pi'] = null; $result[$row['id']]['ca'] = null; $result[$row['id']]['pic'] = null; $result[$row['id']]['deadline'] = null; $result[$row['id']]['new_deadline'] = null; $result[$row['id']]['reason'] = null; $result[$row['id']]['notes'] = null; $result[$row['id']]['last_root'] = $row['last_root']; $result[$row['id']]['exist_good'] = $row['exist_good']; $result[$row['id']]['exist_not_good'] = $row['exist_not_good']; $result[$row['id']]['not_exist'] = $row['not_exist']; $result[$row['id']]['n_a'] = $row['n_a']; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 79
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 79
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 79
2 jumps found. (Code = 77) Position 1 = 81, Position 2 = 188
Branch analysis from position: 81
2 jumps found. (Code = 78) Position 1 = 82, Position 2 = 188
Branch analysis from position: 82
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 116
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 116
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 188
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 188
Branch analysis from position: 79
filename:       /in/nqsFo
function name:  (null)
number of ops:  193
compiled vars:  !0 = $array1, !1 = $array2, !2 = $row, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   29     1        ASSIGN                                                   !1, <array>
  122     2      > FE_RESET_R                                       $6      !0, ->79
          3    > > FE_FETCH_R                                               $6, !2, ->79
  123     4    >   FETCH_DIM_R                                      ~7      !2, 'id_question'
          5        FETCH_DIM_R                                      ~10     !2, 'id'
          6        FETCH_DIM_W                                      $8      !3, ~7
          7        ASSIGN_DIM                                               $8, 'id'
          8        OP_DATA                                                  ~10
  124     9        FETCH_DIM_R                                      ~11     !2, 'id_question'
         10        FETCH_DIM_R                                      ~14     !2, 'id_question'
         11        FETCH_DIM_W                                      $12     !3, ~11
         12        ASSIGN_DIM                                               $12, 'id_question'
         13        OP_DATA                                                  ~14
  125    14        FETCH_DIM_R                                      ~15     !2, 'id_question'
         15        FETCH_DIM_W                                      $16     !3, ~15
         16        ASSIGN_DIM                                               $16, 'type'
         17        OP_DATA                                                  null
  126    18        FETCH_DIM_R                                      ~18     !2, 'id_question'
         19        FETCH_DIM_R                                      ~21     !2, 'answer'
         20        FETCH_DIM_W                                      $19     !3, ~18
         21        ASSIGN_DIM                                               $19, 'answer'
         22        OP_DATA                                                  ~21
  127    23        FETCH_DIM_R                                      ~22     !2, 'id_question'
         24        FETCH_DIM_R                                      ~25     !2, 'pi'
         25        FETCH_DIM_W                                      $23     !3, ~22
         26        ASSIGN_DIM                                               $23, 'pi'
         27        OP_DATA                                                  ~25
  128    28        FETCH_DIM_R                                      ~26     !2, 'id_question'
         29        FETCH_DIM_R                                      ~29     !2, 'ca'
         30        FETCH_DIM_W                                      $27     !3, ~26
         31        ASSIGN_DIM                                               $27, 'ca'
         32        OP_DATA                                                  ~29
  129    33        FETCH_DIM_R                                      ~30     !2, 'id_question'
         34        FETCH_DIM_R                                      ~33     !2, 'pic'
         35        FETCH_DIM_W                                      $31     !3, ~30
         36        ASSIGN_DIM                                               $31, 'pic'
         37        OP_DATA                                                  ~33
  130    38        FETCH_DIM_R                                      ~34     !2, 'id_question'
         39        FETCH_DIM_R                                      ~37     !2, 'deadline'
         40        FETCH_DIM_W                                      $35     !3, ~34
         41        ASSIGN_DIM                                               $35, 'deadline'
         42        OP_DATA                                                  ~37
  131    43        FETCH_DIM_R                                      ~38     !2, 'id_question'
         44        FETCH_DIM_R                                      ~41     !2, 'new_deadline'
         45        FETCH_DIM_W                                      $39     !3, ~38
         46        ASSIGN_DIM                                               $39, 'new_deadline'
         47        OP_DATA                                                  ~41
  132    48        FETCH_DIM_R                                      ~42     !2, 'id_question'
         49        FETCH_DIM_R                                      ~45     !2, 'reason'
         50        FETCH_DIM_W                                      $43     !3, ~42
         51        ASSIGN_DIM                                               $43, 'reason'
         52        OP_DATA                                                  ~45
  133    53        FETCH_DIM_R                                      ~46     !2, 'id_question'
         54        FETCH_DIM_R                                      ~49     !2, 'notes'
         55        FETCH_DIM_W                                      $47     !3, ~46
         56        ASSIGN_DIM                                               $47, 'notes'
         57        OP_DATA                                                  ~49
  134    58        FETCH_DIM_R                                      ~50     !2, 'id_question'
         59        FETCH_DIM_W                                      $51     !3, ~50
         60        ASSIGN_DIM                                               $51, 'last_root'
         61        OP_DATA                                                  null
  135    62        FETCH_DIM_R                                      ~53     !2, 'id_question'
         63        FETCH_DIM_W                                      $54     !3, ~53
         64        ASSIGN_DIM                                               $54, 'exist_good'
         65        OP_DATA                                                  null
  136    66        FETCH_DIM_R                                      ~56     !2, 'id_question'
         67        FETCH_DIM_W                                      $57     !3, ~56
         68        ASSIGN_DIM                                               $57, 'exist_not_good'
         69        OP_DATA                                                  null
  137    70        FETCH_DIM_R                                      ~59     !2, 'id_question'
         71        FETCH_DIM_W                                      $60     !3, ~59
         72        ASSIGN_DIM                                               $60, 'not_exist'
         73        OP_DATA                                                  null
  138    74        FETCH_DIM_R                                      ~62     !2, 'id_question'
         75        FETCH_DIM_W                                      $63     !3, ~62
         76        ASSIGN_DIM                                               $63, 'n_a'
         77        OP_DATA                                                  null
  122    78      > JMP                                                      ->3
         79    >   FE_FREE                                                  $6
  141    80      > FE_RESET_R                                       $65     !1, ->188
         81    > > FE_FETCH_R                                               $65, !2, ->188
  142    82    >   FETCH_DIM_R                                      ~66     !2, 'id'
         83        ISSET_ISEMPTY_DIM_OBJ                         0          !3, ~66
         84      > JMPZ                                                     ~67, ->116
  144    85    >   FETCH_DIM_R                                      ~68     !2, 'id'
         86        FETCH_DIM_R                                      ~71     !2, 'type'
         87        FETCH_DIM_W                                      $69     !3, ~68
         88        ASSIGN_DIM                                               $69, 'type'
         89        OP_DATA                                                  ~71
  145    90        FETCH_DIM_R                                      ~72     !2, 'id'
         91        FETCH_DIM_R                                      ~75     !2, 'last_root'
         92        FETCH_DIM_W                                      $73     !3, ~72
         93        ASSIGN_DIM                                               $73, 'last_root'
         94        OP_DATA                                                  ~75
  146    95        FETCH_DIM_R                                      ~76     !2, 'id'
         96        FETCH_DIM_R                                      ~79     !2, 'exist_good'
         97        FETCH_DIM_W                                      $77     !3, ~76
         98        ASSIGN_DIM                                               $77, 'exist_good'
         99        OP_DATA                                                  ~79
  147   100        FETCH_DIM_R                                      ~80     !2, 'id'
        101        FETCH_DIM_R                                      ~83     !2, 'exist_not_good'
        102        FETCH_DIM_W                                      $81     !3, ~80
        103        ASSIGN_DIM                                               $81, 'exist_not_good'
        104        OP_DATA                                                  ~83
  148   105        FETCH_DIM_R                                      ~84     !2, 'id'
        106        FETCH_DIM_R                                      ~87     !2, 'not_exist'
        107        FETCH_DIM_W                                      $85     !3, ~84
        108        ASSIGN_DIM                                               $85, 'not_exist'
        109        OP_DATA                                                  ~87
  149   110        FETCH_DIM_R                                      ~88     !2, 'id'
        111        FETCH_DIM_R                                      ~91     !2, 'n_a'
        112        FETCH_DIM_W                                      $89     !3, ~88
        113        ASSIGN_DIM                                               $89, 'n_a'
        114        OP_DATA                                                  ~91
  142   115      > JMP                                                      ->187
  151   116    >   FETCH_DIM_R                                      ~92     !2, 'id'
        117        FETCH_DIM_R                                      ~95     !2, 'question'
        118        FETCH_DIM_W                                      $93     !3, ~92
        119        ASSIGN_DIM                                               $93, 'id'
        120        OP_DATA                                                  ~95
  152   121        FETCH_DIM_R                                      ~96     !2, 'id'
        122        FETCH_DIM_W                                      $97     !3, ~96
        123        ASSIGN_DIM                                               $97, 'id_question'
        124        OP_DATA                                                  null
  153   125        FETCH_DIM_R                                      ~99     !2, 'id'
        126        FETCH_DIM_R                                      ~102    !2, 'type'
        127        FETCH_DIM_W                                      $100    !3, ~99
        128        ASSIGN_DIM                                               $100, 'type'
        129        OP_DATA                                                  ~102
  154   130        FETCH_DIM_R                                      ~103    !2, 'id'
        131        FETCH_DIM_W                                      $104    !3, ~103
        132        ASSIGN_DIM                                               $104, 'answer'
        133        OP_DATA                                                  null
  155   134        FETCH_DIM_R                                      ~106    !2, 'id'
        135        FETCH_DIM_W                                      $107    !3, ~106
        136        ASSIGN_DIM                                               $107, 'pi'
        137        OP_DATA                                                  null
  156   138        FETCH_DIM_R                                      ~109    !2, 'id'
        139        FETCH_DIM_W                                      $110    !3, ~109
        140        ASSIGN_DIM                                               $110, 'ca'
        141        OP_DATA                                                  null
  157   142        FETCH_DIM_R                                      ~112    !2, 'id'
        143        FETCH_DIM_W                                      $113    !3, ~112
        144        ASSIGN_DIM                                               $113, 'pic'
        145        OP_DATA                                                  null
  158   146        FETCH_DIM_R                                      ~115    !2, 'id'
        147        FETCH_DIM_W                                      $116    !3, ~115
        148        ASSIGN_DIM                                               $116, 'deadline'
        149        OP_DATA                                                  null
  159   150        FETCH_DIM_R                                      ~118    !2, 'id'
        151        FETCH_DIM_W                                      $119    !3, ~118
        152        ASSIGN_DIM                                               $119, 'new_deadline'
        153        OP_DATA                                                  null
  160   154        FETCH_DIM_R                                      ~121    !2, 'id'
        155        FETCH_DIM_W                                      $122    !3, ~121
        156        ASSIGN_DIM                                               $122, 'reason'
        157        OP_DATA                                                  null
  161   158        FETCH_DIM_R                                      ~124    !2, 'id'
        159        FETCH_DIM_W                                      $125    !3, ~124
        160        ASSIGN_DIM                                               $125, 'notes'
        161        OP_DATA                                                  null
  162   162        FETCH_DIM_R                                      ~127    !2, 'id'
        163        FETCH_DIM_R                                      ~130    !2, 'last_root'
        164        FETCH_DIM_W                                      $128    !3, ~127
        165        ASSIGN_DIM                                               $128, 'last_root'
        166        OP_DATA                                                  ~130
  163   167        FETCH_DIM_R                                      ~131    !2, 'id'
        168        FETCH_DIM_R                                      ~134    !2, 'exist_good'
        169        FETCH_DIM_W                                      $132    !3, ~131
        170        ASSIGN_DIM                                               $132, 'exist_good'
        171        OP_DATA                                                  ~134
  164   172        FETCH_DIM_R                                      ~135    !2, 'id'
        173        FETCH_DIM_R                                      ~138    !2, 'exist_not_good'
        174        FETCH_DIM_W                                      $136    !3, ~135
        175        ASSIGN_DIM                                               $136, 'exist_not_good'
        176        OP_DATA                                                  ~138
  165   177        FETCH_DIM_R                                      ~139    !2, 'id'
        178        FETCH_DIM_R                                      ~142    !2, 'not_exist'
        179        FETCH_DIM_W                                      $140    !3, ~139
        180        ASSIGN_DIM                                               $140, 'not_exist'
        181        OP_DATA                                                  ~142
  166   182        FETCH_DIM_R                                      ~143    !2, 'id'
        183        FETCH_DIM_R                                      ~146    !2, 'n_a'
        184        FETCH_DIM_W                                      $144    !3, ~143
        185        ASSIGN_DIM                                               $144, 'n_a'
        186        OP_DATA                                                  ~146
  141   187    > > JMP                                                      ->81
        188    >   FE_FREE                                                  $65
  169   189        INIT_FCALL                                               'var_export'
        190        SEND_VAR                                                 !3
        191        DO_ICALL                                                 
        192      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.75 ms | 1015 KiB | 14 Q