3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '//home/foo:/bin/sh'; $i = count($str); $pos = strrpos($str, '/'); echo substr($str, 0, $i - $pos);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oCUUN
function name:  (null)
number of ops:  16
compiled vars:  !0 = $str, !1 = $i, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%2Fhome%2Ffoo%3A%2Fbin%2Fsh'
    4     1        COUNT                                            ~4      !0
          2        ASSIGN                                                   !1, ~4
    5     3        INIT_FCALL                                               'strrpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '%2F'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !2, $6
    6     8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SUB                                              ~8      !1, !2
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                         $9      
         14        ECHO                                                     $9
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.96 ms | 1394 KiB | 17 Q