3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'http://localhost/new-123-rugby/compet/ition.php?croncode=12345678'; $array = explode('/', $string); $array[count($array) - 1] = ''; // empty the last component echo(implode('/', $array)); // join the pieces back
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMR0p
function name:  (null)
number of ops:  16
compiled vars:  !0 = $string, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Flocalhost%2Fnew-123-rugby%2Fcompet%2Fition.php%3Fcroncode%3D12345678'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    6     6        COUNT                                            ~5      !1
          7        SUB                                              ~6      ~5, 1
          8        ASSIGN_DIM                                               !1, ~6
          9        OP_DATA                                                  ''
    7    10        INIT_FCALL                                               'implode'
         11        SEND_VAL                                                 '%2F'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $8      
         14        ECHO                                                     $8
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.26 ms | 1394 KiB | 17 Q