3v4l.org

run code in 300+ PHP versions simultaneously
<?php $qry = '[url="google.com"]google[/url] and [img]image here[/img]'; echo preg_replace('~\[(img|url)\b[^]]*](.*?)\[/\1]~is', 'REPLACED', $qry);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a8iWi
function name:  (null)
number of ops:  8
compiled vars:  !0 = $qry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Burl%3D%22google.com%22%5Dgoogle%5B%2Furl%5D+and+%5Bimg%5Dimage+here%5B%2Fimg%5D'
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7E%5C%5B%28img%7Curl%29%5Cb%5B%5E%5D%5D%2A%5D%28.%2A%3F%29%5C%5B%2F%5C1%5D%7Eis'
          3        SEND_VAL                                                 'REPLACED'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.23 ms | 1398 KiB | 15 Q