3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "blur/blur/myPhotoName_20170818_111453.jpg"; $pos = strrpos($str, "/")+1; $str = substr($str, $pos, strpos($str, "_")-$pos) . substr($str, strpos($str, ".")); Echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d411c
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str, !1 = $pos
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'blur%2Fblur%2FmyPhotoName_20170818_111453.jpg'
    3     1        INIT_FCALL                                                   'strrpos'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     '%2F'
          4        DO_ICALL                                             $3      
          5        ADD                                                  ~4      $3, 1
          6        ASSIGN                                                       !1, ~4
    4     7        FRAMELESS_ICALL_2                strpos              ~6      !0, '_'
          8        SUB                                                  ~7      ~6, !1
          9        FRAMELESS_ICALL_3                substr              ~8      !0, !1
         10        OP_DATA                                                      ~7
         11        FRAMELESS_ICALL_2                strpos              ~9      !0, '.'
         12        FRAMELESS_ICALL_2                substr              ~10     !0, ~9
         13        CONCAT                                               ~11     ~8, ~10
         14        ASSIGN                                                       !0, ~11
    6    15        ECHO                                                         !0
         16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
225.43 ms | 2060 KiB | 18 Q