3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( 'a','b','c','d','e','f' ); $b = array( 'x', 'z', 'y' ); function arrayInsertAfter(&$array, $position, $insert) { return $array = array_merge(array_slice($array, 0, $position), $insert, array_slice($array, $position)); } print_r(arrayInsertAfter($a, 0, $b));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oWSKo
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   12     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'arrayinsertafter'
          4        SEND_REF                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function arrayinsertafter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oWSKo
function name:  arrayInsertAfter
number of ops:  20
compiled vars:  !0 = $array, !1 = $position, !2 = $insert
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    8     3        INIT_FCALL                                               'array_merge'
          4        INIT_FCALL                                               'array_slice'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        SEND_VAR                                                 !2
         11        INIT_FCALL                                               'array_slice'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                         $5      
         17        ASSIGN                                           ~6      !0, $5
         18      > RETURN                                                   ~6
    9    19*     > RETURN                                                   null

End of function arrayinsertafter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.09 ms | 1399 KiB | 20 Q