3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'http://localhost/new-123-rugby/competition.php?croncode=12345678/'; $array = explode('/', $string); array_pop($array); // ignore the returned value, we don't need it echo(implode('/', $array).'/'); // join the pieces back, add the last '/'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZVHQL
function name:  (null)
number of ops:  16
compiled vars:  !0 = $string, !1 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Flocalhost%2Fnew-123-rugby%2Fcompetition.php%3Fcroncode%3D12345678%2F'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    5     6        INIT_FCALL                                               'array_pop'
          7        SEND_REF                                                 !1
          8        DO_ICALL                                                 
    6     9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%2F'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13        CONCAT                                           ~7      $6, '%2F'
         14        ECHO                                                     ~7
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.07 ms | 939 KiB | 20 Q