3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (array( 'path_without_slash', 'path/to/file/', 'path/to/file', ) as $somestring) { var_dump((string)substr($somestring, strrpos("/$somestring", '/'))); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 17
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/Oa9fq
function name:  (null)
number of ops:  19
compiled vars:  !0 = $somestring
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > FE_RESET_R                                       $1      <array>, ->17
          1    > > FE_FETCH_R                                               $1, !0, ->17
    8     2    >   INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        INIT_FCALL                                               'strrpos'
          6        NOP                                                      
          7        FAST_CONCAT                                      ~2      '%2F', !0
          8        SEND_VAL                                                 ~2
          9        SEND_VAL                                                 '%2F'
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        CAST                                          6  ~5      $4
         14        SEND_VAL                                                 ~5
         15        DO_ICALL                                                 
    4    16      > JMP                                                      ->1
         17    >   FE_FREE                                                  $1
    9    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.59 ms | 1001 KiB | 16 Q