3v4l.org

run code in 500+ PHP versions simultaneously
<?php function AddInTheMiddle($start, $where, $what){ $arr = explode("/", $what); $str = implode("/", array_splice($arr,$start,$where)) . '/xxx/' . implode("/", $arr);; return $str; } $str = 'solutions-en/rail-technologies/track-components/name-of-product'; $str = AddInTheMiddle(1, 2, $str); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m98io
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                       !0, 'solutions-en%2Frail-technologies%2Ftrack-components%2Fname-of-product'
   11     1        INIT_FCALL                                                   'addinthemiddle'
          2        SEND_VAL                                                     1
          3        SEND_VAL                                                     2
          4        SEND_VAR                                                     !0
          5        DO_FCALL                                          0  $2      
          6        ASSIGN                                                       !0, $2
   12     7        ECHO                                                         !0
   13     8      > RETURN                                                       1

Function addinthemiddle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m98io
function name:  AddInTheMiddle
number of ops:  20
compiled vars:  !0 = $start, !1 = $where, !2 = $what, !3 = $arr, !4 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
    4     3        INIT_FCALL                                                   'explode'
          4        SEND_VAL                                                     '%2F'
          5        SEND_VAR                                                     !2
          6        DO_ICALL                                             $5      
          7        ASSIGN                                                       !3, $5
    5     8        INIT_FCALL                                                   'array_splice'
          9        SEND_REF                                                     !3
         10        SEND_VAR                                                     !0
         11        SEND_VAR                                                     !1
         12        DO_ICALL                                             $7      
         13        FRAMELESS_ICALL_2                implode             ~8      '%2F', $7
         14        CONCAT                                               ~9      ~8, '%2Fxxx%2F'
         15        FRAMELESS_ICALL_2                implode             ~10     '%2F', !3
         16        CONCAT                                               ~11     ~9, ~10
         17        ASSIGN                                                       !4, ~11
    7    18      > RETURN                                                       !4
    8    19*     > RETURN                                                       null

End of function addinthemiddle

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
208.16 ms | 2126 KiB | 16 Q