3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[quote=foo]<script src='http://www.example.com' data-junk='[/quote]'>"; $text = preg_replace('#\[quote\=(.+)\]((?>(?R)|.)+)\[\/quote\]#iUs', '<div class="quote">$2</div><div class="quote-by">By: $1</div>', $text, -1, $count); var_dump($text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lup8l
function name:  (null)
number of ops:  13
compiled vars:  !0 = $text, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Bquote%3Dfoo%5D%3Cscript+src%3D%27http%3A%2F%2Fwww.example.com%27+data-junk%3D%27%5B%2Fquote%5D%27%3E'
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%23%5C%5Bquote%5C%3D%28.%2B%29%5C%5D%28%28%3F%3E%28%3FR%29%7C.%29%2B%29%5C%5B%5C%2Fquote%5C%5D%23iUs'
          3        SEND_VAL                                                 '%3Cdiv+class%3D%22quote%22%3E%242%3C%2Fdiv%3E%3Cdiv+class%3D%22quote-by%22%3EBy%3A+%241%3C%2Fdiv%3E'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 -1
          6        SEND_REF                                                 !1
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
    5     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.14 ms | 1398 KiB | 17 Q