3v4l.org

run code in 500+ PHP versions simultaneously
<?php $file = '/css/base.css'; $mtime = 1221534296; echo "Yours: " , preg_replace('{\\.([^./]+)$}', ".$mtime.\$1", $file); echo "\n---\nMine: " , preg_replace('~(?=[^./]+$)~', "$mtime.", $file, 1); echo "\n---\nOr: " , preg_replace('~\.\K(?=[^./]+$)~', "$mtime.", $file); echo "\n---\nOr: " , preg_replace('~(?=\.[^./]+$)~', ".$mtime", $file);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PPbUW
function name:  (null)
number of ops:  32
compiled vars:  !0 = $file, !1 = $mtime
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%2Fcss%2Fbase.css'
    4     1        ASSIGN                                                       !1, 1221534296
    6     2        ECHO                                                         'Yours%3A+'
          3        ROPE_INIT                                         3  ~5      '.'
          4        ROPE_ADD                                          1  ~5      ~5, !1
          5        ROPE_END                                          2  ~4      ~5, '.%241'
          6        FRAMELESS_ICALL_3                preg_replace        ~7      '%7B%5C.%28%5B%5E.%2F%5D%2B%29%24%7D', ~4
          7        OP_DATA                                                      !0
          8        ECHO                                                         ~7
    8     9        ECHO                                                         '%0A---%0AMine%3A+'
         10        INIT_FCALL                                                   'preg_replace'
         11        SEND_VAL                                                     '%7E%28%3F%3D%5B%5E.%2F%5D%2B%24%29%7E'
         12        NOP                                                          
         13        FAST_CONCAT                                          ~8      !1, '.'
         14        SEND_VAL                                                     ~8
         15        SEND_VAR                                                     !0
         16        SEND_VAL                                                     1
         17        DO_ICALL                                             $9      
         18        ECHO                                                         $9
   10    19        ECHO                                                         '%0A---%0AOr%3A+'
         20        NOP                                                          
         21        FAST_CONCAT                                          ~10     !1, '.'
         22        FRAMELESS_ICALL_3                preg_replace        ~11     '%7E%5C.%5CK%28%3F%3D%5B%5E.%2F%5D%2B%24%29%7E', ~10
         23        OP_DATA                                                      !0
         24        ECHO                                                         ~11
   12    25        ECHO                                                         '%0A---%0AOr%3A+'
         26        NOP                                                          
         27        FAST_CONCAT                                          ~12     '.', !1
         28        FRAMELESS_ICALL_3                preg_replace        ~13     '%7E%28%3F%3D%5C.%5B%5E.%2F%5D%2B%24%29%7E', ~12
         29        OP_DATA                                                      !0
         30        ECHO                                                         ~13
         31      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.56 ms | 2162 KiB | 14 Q