3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stringToReplace = "opening-ceremony-600x450.d20140220-u162540.jpg"; $removeTimestamp = strlen($stringToReplace); $removeTimestamp = floor($removeTimestamp - 21); $example_1 = substr_replace($stringToReplace, "jpg",$removeTimestamp); echo "Example 1: ".$example_1."\n\n"; $stringToReplace = "marc-by-marc-jacobs-13-black-136831_3-90x90.d20140220-u071915.jpg"; $removeTimestamp = strlen($stringToReplace); $removeTimestamp = floor($removeTimestamp - 21); $example_2 = substr_replace($stringToReplace, "jpg",$removeTimestamp); echo "Example 1: ".$example_2;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pYlDY
function name:  (null)
number of ops:  34
compiled vars:  !0 = $stringToReplace, !1 = $removeTimestamp, !2 = $example_1, !3 = $example_2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'opening-ceremony-600x450.d20140220-u162540.jpg'
    3     1        STRLEN                                           ~5      !0
          2        ASSIGN                                                   !1, ~5
    4     3        INIT_FCALL                                               'floor'
          4        SUB                                              ~7      !1, 21
          5        SEND_VAL                                                 ~7
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !1, $8
    5     8        INIT_FCALL                                               'substr_replace'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 'jpg'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !2, $10
    6    14        CONCAT                                           ~12     'Example+1%3A+', !2
         15        CONCAT                                           ~13     ~12, '%0A%0A'
         16        ECHO                                                     ~13
    8    17        ASSIGN                                                   !0, 'marc-by-marc-jacobs-13-black-136831_3-90x90.d20140220-u071915.jpg'
    9    18        STRLEN                                           ~15     !0
         19        ASSIGN                                                   !1, ~15
   10    20        INIT_FCALL                                               'floor'
         21        SUB                                              ~17     !1, 21
         22        SEND_VAL                                                 ~17
         23        DO_ICALL                                         $18     
         24        ASSIGN                                                   !1, $18
   11    25        INIT_FCALL                                               'substr_replace'
         26        SEND_VAR                                                 !0
         27        SEND_VAL                                                 'jpg'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $20     
         30        ASSIGN                                                   !3, $20
   12    31        CONCAT                                           ~22     'Example+1%3A+', !3
         32        ECHO                                                     ~22
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.54 ms | 1396 KiB | 17 Q