3v4l.org

run code in 300+ 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:  29
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        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 '_'
         13        DO_ICALL                                         $6      
         14        SUB                                              ~7      $6, !1
         15        SEND_VAL                                                 ~7
         16        DO_ICALL                                         $8      
         17        INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !0
         19        INIT_FCALL                                               'strpos'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 '.'
         22        DO_ICALL                                         $9      
         23        SEND_VAR                                                 $9
         24        DO_ICALL                                         $10     
         25        CONCAT                                           ~11     $8, $10
         26        ASSIGN                                                   !0, ~11
    6    27        ECHO                                                     !0
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.94 ms | 1395 KiB | 19 Q