3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'SELECT * FROM site_customers LEFT JOIN site_products'; $pattern = '/SELECT \* FROM (\bsite_[a-zA-Z0-9]*) LEFT JOIN (\bsite_[a-zA-Z0-9]*)/'; $replacement = 'SELECT * FROM $1_02 LEFT JOIN new_$2'; echo preg_replace($pattern, $replacement, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0YorR
function name:  (null)
number of ops:  10
compiled vars:  !0 = $string, !1 = $pattern, !2 = $replacement
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'SELECT+%2A+FROM+site_customers+LEFT+JOIN+site_products'
    5     1        ASSIGN                                                   !1, '%2FSELECT+%5C%2A+FROM+%28%5Cbsite_%5Ba-zA-Z0-9%5D%2A%29+LEFT+JOIN+%28%5Cbsite_%5Ba-zA-Z0-9%5D%2A%29%2F'
    7     2        ASSIGN                                                   !2, 'SELECT+%2A+FROM+%241_02+LEFT+JOIN+new_%242'
    9     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ECHO                                                     $6
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.9 ms | 1009 KiB | 14 Q