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; 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/2rbO9
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>
   21     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                                                 
   22    11      > RETURN                                                   1

Function merge_arrays_by_index:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/2rbO9
function name:  merge_arrays_by_index
number of ops:  19
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
    8     5        TYPE_CHECK                                  124          !1
          6      > JMPZ                                                     ~7, ->10
   10     7    >   ASSIGN_DIM                                               !2
          8        OP_DATA                                                  !1
          9      > JMP                                                      ->17
   14    10    > > FE_RESET_R                                       $9      !1, ->16
         11    > > FE_FETCH_R                                       ~10     $9, !3, ->16
         12    >   ASSIGN                                                   !4, ~10
   16    13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  !3
   14    15      > JMP                                                      ->11
         16    >   FE_FREE                                                  $9
   19    17    > > RETURN                                                   !2
   20    18*     > RETURN                                                   null

End of function merge_arrays_by_index

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.35 ms | 1396 KiB | 17 Q