3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex='#^(<[^>]+>)*<img#i'; var_dump(preg_match($regex,'<p><span><a href=""><img src="some.jpg"></a></span></p>')); var_dump(preg_match($regex,'<p>Text text text<span><a href=""><img src="some.jpg"></a></span></p>')); var_dump(preg_match($regex,'<p><span>Text text text<a href=""><img src="some.jpg"></a></span></p>'));?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ePQFG
function name:  (null)
number of ops:  23
compiled vars:  !0 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%23%5E%28%3C%5B%5E%3E%5D%2B%3E%29%2A%3Cimg%23i'
    3     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 '%3Cp%3E%3Cspan%3E%3Ca+href%3D%22%22%3E%3Cimg+src%3D%22some.jpg%22%3E%3C%2Fa%3E%3C%2Fspan%3E%3C%2Fp%3E'
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
    4     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'preg_match'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '%3Cp%3EText+text+text%3Cspan%3E%3Ca+href%3D%22%22%3E%3Cimg+src%3D%22some.jpg%22%3E%3C%2Fa%3E%3C%2Fspan%3E%3C%2Fp%3E'
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
    5    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'preg_match'
         17        SEND_VAR                                                 !0
         18        SEND_VAL                                                 '%3Cp%3E%3Cspan%3EText+text+text%3Ca+href%3D%22%22%3E%3Cimg+src%3D%22some.jpg%22%3E%3C%2Fa%3E%3C%2Fspan%3E%3C%2Fp%3E'
         19        DO_ICALL                                         $6      
         20        SEND_VAR                                                 $6
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.43 ms | 1395 KiB | 17 Q