3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<'AHA' abc [code lang='javascript'] var a = 2.5; [/code] bcd [code lang='php'] $this->foo(); [/code] cde [code lang='html'] <p clas = 'bar'><span>hello world</span></p> [/code] def AHA; $r='/((^|\[\/code\]).*?(\[code[^\]]*?\]|$))/s'; preg_match_all($r, $str, $a); print_r($a[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jeoab
function name:  (null)
number of ops:  12
compiled vars:  !0 = $str, !1 = $r, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'abc%0A%5Bcode+lang%3D%27javascript%27%5D%0A%09var+a+%3D+2.5%3B%0A%5B%2Fcode%5D%0Abcd%0A%5Bcode+lang%3D%27php%27%5D%0A%09%24this-%3Efoo%28%29%3B%0A%5B%2Fcode%5D%0Acde%0A%5Bcode+lang%3D%27html%27%5D%0A%09%3Cp+clas+%3D+%27bar%27%3E%3Cspan%3Ehello+world%3C%2Fspan%3E%3C%2Fp%3E%0A%5B%2Fcode%5D%0Adef'
   17     1        ASSIGN                                                   !1, '%2F%28%28%5E%7C%5C%5B%5C%2Fcode%5C%5D%29.%2A%3F%28%5C%5Bcode%5B%5E%5C%5D%5D%2A%3F%5C%5D%7C%24%29%29%2Fs'
   18     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   19     7        INIT_FCALL                                               'print_r'
          8        FETCH_DIM_R                                      ~6      !2, 0
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.33 ms | 1395 KiB | 17 Q