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; } $test = merge_arrays_by_index($array2,$array2); print_r($test); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c5lVW
function name:  (null)
number of ops:  11
compiled vars:  !0 = $array1, !1 = $array2, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
   21     2        INIT_FCALL                                               'merge_arrays_by_index'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   22     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
   23    10      > 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/c5lVW
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:
152 ms | 944 KiB | 17 Q