3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array(array(77, 87), array(23, 45)); $array2 = array("w3resource", "com"); function merge_arrays_by_index($x, $y) { $temp = array(); $temp[] = $x; echo "First array"; var_dump($temp); if(is_scalar($y)) { $temp[] = $y; } else { foreach($y as $k => $v) { $temp[] = $v; } } return $temp; } echo '<pre>'; print_r(array_map('merge_arrays_by_index',$array2, $array1)); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lPCuT
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
   26     2        ECHO                                                     '%3Cpre%3E'
          3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'array_map'
          5        SEND_VAL                                                 'merge_arrays_by_index'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
   27    11      > RETURN                                                   1

Function merge_arrays_by_index:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/lPCuT
function name:  merge_arrays_by_index
number of ops:  23
compiled vars:  !0 = $x, !1 = $y, !2 = $temp, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        ASSIGN                                                   !2, <array>
    7     3        ASSIGN_DIM                                               !2
          4        OP_DATA                                                  !0
    9     5        ECHO                                                     'First+array'
   11     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                                 
   13     9        TYPE_CHECK                                  124          !1
         10      > JMPZ                                                     ~8, ->14
   15    11    >   ASSIGN_DIM                                               !2
         12        OP_DATA                                                  !1
         13      > JMP                                                      ->21
   19    14    > > FE_RESET_R                                       $10     !1, ->20
         15    > > FE_FETCH_R                                       ~11     $10, !3, ->20
         16    >   ASSIGN                                                   !4, ~11
   21    17        ASSIGN_DIM                                               !2
         18        OP_DATA                                                  !3
   19    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $10
   24    21    > > RETURN                                                   !2
   25    22*     > RETURN                                                   null

End of function merge_arrays_by_index

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.72 ms | 1400 KiB | 19 Q