3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'The story is inspired by the Operation Batla House that took place in 2008 '; $tag = '2.0'; $pattern = '/(\s|^)'.preg_quote($tag, '/').'(?=[^a-z^A-Z])/i'; echo preg_replace($pattern, '2.0', $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ljIdK
function name:  (null)
number of ops:  16
compiled vars:  !0 = $string, !1 = $tag, !2 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'The+story+is+inspired+by+the+Operation+Batla+House+that+took+place+in+2008+'
    4     1        ASSIGN                                                   !1, '2.0'
    5     2        INIT_FCALL                                               'preg_quote'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 '%2F'
          5        DO_ICALL                                         $5      
          6        CONCAT                                           ~6      '%2F%28%5Cs%7C%5E%29', $5
          7        CONCAT                                           ~7      ~6, '%28%3F%3D%5B%5Ea-z%5EA-Z%5D%29%2Fi'
          8        ASSIGN                                                   !2, ~7
    6     9        INIT_FCALL                                               'preg_replace'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 '2.0'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $9      
         14        ECHO                                                     $9
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.27 ms | 1002 KiB | 15 Q