3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = preg_replace('~\[(img|url)\](.*)\[/\1\]~i', 'REPLACED', '[img]test[/img][not]img[/not][url]http][/url][img]second image[/img]'); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8SdNd
function name:  (null)
number of ops:  8
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'preg_replace'
          1        SEND_VAL                                                 '%7E%5C%5B%28img%7Curl%29%5C%5D%28.%2A%29%5C%5B%2F%5C1%5C%5D%7Ei'
          2        SEND_VAL                                                 'REPLACED'
          3        SEND_VAL                                                 '%5Bimg%5Dtest%5B%2Fimg%5D%5Bnot%5Dimg%5B%2Fnot%5D%5Burl%5Dhttp%5D%5B%2Furl%5D%5Bimg%5Dsecond+image%5B%2Fimg%5D'
          4        DO_ICALL                                         $1      
          5        ASSIGN                                                   !0, $1
    3     6        ECHO                                                     !0
    4     7      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.7 ms | 1008 KiB | 14 Q