3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo(array $p, array $q): array { $r = [array_shift($p)]; foreach ($q as $x) { $r[] = $x; $r[] = array_shift($p); } return $r; } print_r( foo([210,11,12], ['-', '/']) ); print_r( foo([210,11,12,12], ['-','/','/']) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0ud8
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                                   'print_r'
   15     1        INIT_FCALL                                                   'foo'
          2        SEND_VAL                                                     <array>
          3        SEND_VAL                                                     <array>
          4        DO_FCALL                                          0  $0      
          5        SEND_VAR                                                     $0
   14     6        DO_ICALL                                                     
   18     7        INIT_FCALL                                                   'print_r'
   19     8        INIT_FCALL                                                   'foo'
          9        SEND_VAL                                                     <array>
         10        SEND_VAL                                                     <array>
         11        DO_FCALL                                          0  $2      
         12        SEND_VAR                                                     $2
   18    13        DO_ICALL                                                     
   20    14      > RETURN                                                       1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/F0ud8
function name:  foo
number of ops:  22
compiled vars:  !0 = $p, !1 = $q, !2 = $r, !3 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    4     2        INIT_FCALL                                                   'array_shift'
          3        SEND_REF                                                     !0
          4        DO_ICALL                                             $4      
          5        INIT_ARRAY                                           ~5      $4
          6        ASSIGN                                                       !2, ~5
    6     7      > FE_RESET_R                                           $7      !1, ->17
          8    > > FE_FETCH_R                                                   $7, !3, ->17
    7     9    >   ASSIGN_DIM                                                   !2
         10        OP_DATA                                                      !3
    8    11        INIT_FCALL                                                   'array_shift'
         12        SEND_REF                                                     !0
         13        DO_ICALL                                             $10     
         14        ASSIGN_DIM                                                   !2
         15        OP_DATA                                                      $10
    6    16      > JMP                                                          ->8
         17    >   FE_FREE                                                      $7
   11    18        VERIFY_RETURN_TYPE                                           !2
         19      > RETURN                                                       !2
   12    20*       VERIFY_RETURN_TYPE                                           
         21*     > RETURN                                                       null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
190.02 ms | 2156 KiB | 17 Q