3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<div><a href=%http://link1%><img></a><a href=%http://link2%><img></a></div>'; $re = '|<div>(<a((?!href)(?!<).)+?href=%([^%]+?)%((?!</a>).)+?</a>){2}</div>|'; $matches = array(); var_dump(preg_match($re, $string, $matches)); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1I5t5
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $re, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cdiv%3E%3Ca+href%3D%25http%3A%2F%2Flink1%25%3E%3Cimg%3E%3C%2Fa%3E%3Ca+href%3D%25http%3A%2F%2Flink2%25%3E%3Cimg%3E%3C%2Fa%3E%3C%2Fdiv%3E'
    4     1        ASSIGN                                                   !1, '%7C%3Cdiv%3E%28%3Ca%28%28%3F%21href%29%28%3F%21%3C%29.%29%2B%3Fhref%3D%25%28%5B%5E%25%5D%2B%3F%29%25%28%28%3F%21%3C%2Fa%3E%29.%29%2B%3F%3C%2Fa%3E%29%7B2%7D%3C%2Fdiv%3E%7C'
    5     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !2
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
    8    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.8 ms | 1386 KiB | 19 Q