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" ) ); foreach($questions as $key=>$value){ $k = array_search($value['questionid'], array_column($answers, 'questionId')); if($k!==FALSE){ $questions[$key]['question'] = $answers[$k]['question']; $questions[$key]['type'] = $answers[$k]['type']; } } print_r($questions); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/O4uDc
function name:  (null)
number of ops:  33
compiled vars:  !0 = $questions, !1 = $answers, !2 = $value, !3 = $key, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   25     1        ASSIGN                                                   !1, <array>
   33     2      > FE_RESET_R                                       $7      !0, ->28
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->28
          4    >   ASSIGN                                                   !3, ~8
   34     5        INIT_FCALL                                               'array_search'
          6        FETCH_DIM_R                                      ~10     !2, 'questionid'
          7        SEND_VAL                                                 ~10
          8        INIT_FCALL                                               'array_column'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 'questionId'
         11        DO_ICALL                                         $11     
         12        SEND_VAR                                                 $11
         13        DO_ICALL                                         $12     
         14        ASSIGN                                                   !4, $12
   35    15        TYPE_CHECK                                  1018          !4
         16      > JMPZ                                                     ~14, ->27
   36    17    >   FETCH_DIM_R                                      ~17     !1, !4
         18        FETCH_DIM_R                                      ~18     ~17, 'question'
         19        FETCH_DIM_W                                      $15     !0, !3
         20        ASSIGN_DIM                                               $15, 'question'
         21        OP_DATA                                                  ~18
   37    22        FETCH_DIM_R                                      ~21     !1, !4
         23        FETCH_DIM_R                                      ~22     ~21, 'type'
         24        FETCH_DIM_W                                      $19     !0, !3
         25        ASSIGN_DIM                                               $19, 'type'
         26        OP_DATA                                                  ~22
   33    27    > > JMP                                                      ->3
         28    >   FE_FREE                                                  $7
   40    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
   41    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.44 ms | 1003 KiB | 16 Q