3v4l.org

run code in 300+ PHP versions simultaneously
<?php $questions = Array ( "0" => Array ( "questionid" => "28f68dc4-acc6-4ab7-956d-ca41abf3a4c2", "answer" =>"Antwoord 89", "extra" =>null ) , "1" => Array ( "questionid" =>"28f-28f68dc4-acc6-4ab7-956d-ca41abf3a4c20", "answer" => "Antwoord 20", "extra" => "Extra informatie 20" ) , "2" => Array ( "questionid" => "d8f-28f68dc4-acc6-4ab7-956d-ca41abf3a4c20", "answer" => "Antwoord 3", "extra" =>null ) ); $answers = Array ( "0" => Array ( "questionId" => "28f-28f68dc4-acc6-4ab7-956d-ca41abf3a4c20", "question" => "1. Question 1", "type" => "typequestion/question-text-input" ) ); $combineArray = []; foreach($questions as $key=>$value){ $combineArray[$key] = $value; $k = array_search($value['questionid'], array_column($answers, 'questionId')); if($k!==FALSE){ $combineArray[$key]['question'] = $answers[$k]['question']; $combineArray[$key]['type'] = $answers[$k]['type']; } } print_r($combineArray); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 31
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 31
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 30
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 30
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/9vhla
function name:  (null)
number of ops:  36
compiled vars:  !0 = $questions, !1 = $answers, !2 = $combineArray, !3 = $value, !4 = $key, !5 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   25     1        ASSIGN                                                   !1, <array>
   33     2        ASSIGN                                                   !2, <array>
   34     3      > FE_RESET_R                                       $9      !0, ->31
          4    > > FE_FETCH_R                                       ~10     $9, !3, ->31
          5    >   ASSIGN                                                   !4, ~10
   35     6        ASSIGN_DIM                                               !2, !4
          7        OP_DATA                                                  !3
   36     8        INIT_FCALL                                               'array_search'
          9        FETCH_DIM_R                                      ~13     !3, 'questionid'
         10        SEND_VAL                                                 ~13
         11        INIT_FCALL                                               'array_column'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 'questionId'
         14        DO_ICALL                                         $14     
         15        SEND_VAR                                                 $14
         16        DO_ICALL                                         $15     
         17        ASSIGN                                                   !5, $15
   37    18        TYPE_CHECK                                  1018          !5
         19      > JMPZ                                                     ~17, ->30
   38    20    >   FETCH_DIM_R                                      ~20     !1, !5
         21        FETCH_DIM_R                                      ~21     ~20, 'question'
         22        FETCH_DIM_W                                      $18     !2, !4
         23        ASSIGN_DIM                                               $18, 'question'
         24        OP_DATA                                                  ~21
   39    25        FETCH_DIM_R                                      ~24     !1, !5
         26        FETCH_DIM_R                                      ~25     ~24, 'type'
         27        FETCH_DIM_W                                      $22     !2, !4
         28        ASSIGN_DIM                                               $22, 'type'
         29        OP_DATA                                                  ~25
   34    30    > > JMP                                                      ->4
         31    >   FE_FREE                                                  $9
   44    32        INIT_FCALL                                               'print_r'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
   45    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.42 ms | 1003 KiB | 16 Q