3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'polo-ralph-lauren-grey-v-neck-sweater_99912_3-300x300.d20140220-u175918.jpg'; if (strpos($key, '.d201402') !== FALSE){ $stringToReplace = $key; $removeTimestamp = strlen($stringToReplace); $removeTimestamp = floor($removeTimestamp - 21); $keytemp = substr_replace($stringToReplace, "jpg", $removeTimestamp); rename($key, $keytemp); echo 'Filename replaced '; echo $key; echo $keytemp; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 28
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/48t2Q
function name:  (null)
number of ops:  29
compiled vars:  !0 = $key, !1 = $stringToReplace, !2 = $removeTimestamp, !3 = $keytemp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'polo-ralph-lauren-grey-v-neck-sweater_99912_3-300x300.d20140220-u175918.jpg'
    3     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.d201402'
          4        DO_ICALL                                         $5      
          5        TYPE_CHECK                                  1018          $5
          6      > JMPZ                                                     ~6, ->28
    4     7    >   ASSIGN                                                   !1, !0
    5     8        STRLEN                                           ~8      !1
          9        ASSIGN                                                   !2, ~8
    6    10        INIT_FCALL                                               'floor'
         11        SUB                                              ~10     !2, 21
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !2, $11
    7    15        INIT_FCALL                                               'substr_replace'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 'jpg'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $13     
         20        ASSIGN                                                   !3, $13
    8    21        INIT_FCALL                                               'rename'
         22        SEND_VAR                                                 !0
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
   10    25        ECHO                                                     'Filename+replaced+'
   11    26        ECHO                                                     !0
   12    27        ECHO                                                     !3
   16    28    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.76 ms | 1387 KiB | 21 Q