3v4l.org

run code in 500+ PHP versions simultaneously
<?php $search = 'The'; $replace = 'A'; $subject = "The Quick Brown Fox Jumps Over The Lazy Dog's Thermos!"; echo preg_replace( '/.*\K' . preg_quote($search, '/') . '/i', $replace, $subject );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q8InS
function name:  (null)
number of ops:  13
compiled vars:  !0 = $search, !1 = $replace, !2 = $subject
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'The'
    4     1        ASSIGN                                                       !1, 'A'
    5     2        ASSIGN                                                       !2, 'The+Quick+Brown+Fox+Jumps+Over+The+Lazy+Dog%27s+Thermos%21'
    8     3        INIT_FCALL                                                   'preg_quote'
          4        SEND_VAR                                                     !0
          5        SEND_VAL                                                     '%2F'
          6        DO_ICALL                                             $6      
          7        CONCAT                                               ~7      '%2F.%2A%5CK', $6
          8        CONCAT                                               ~8      ~7, '%2Fi'
    7     9        FRAMELESS_ICALL_3                preg_replace        ~9      ~8, !1
   10    10        OP_DATA                                                      !2
         11        ECHO                                                         ~9
   11    12      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.82 ms | 2108 KiB | 14 Q