3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stringToReplace = "opening-ceremony-600x450.d20140220-u162540.jpg'"; $removeTimestamp = strlen($stringToReplace); $string = substr_replace($stringToReplace, ".jpg", 12, $removeTimestamp); echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VWCaT
function name:  (null)
number of ops:  12
compiled vars:  !0 = $stringToReplace, !1 = $removeTimestamp, !2 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'opening-ceremony-600x450.d20140220-u162540.jpg%27'
    3     1        STRLEN                                           ~4      !0
          2        ASSIGN                                                   !1, ~4
    4     3        INIT_FCALL                                               'substr_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '.jpg'
          6        SEND_VAL                                                 12
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
    5    10        ECHO                                                     !2
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.36 ms | 1385 KiB | 15 Q