3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Dit is een link: <a href="bla.html">Tralalala</a>, en nog eentje: <a href="bla.htmlie">Tralalala</a>'; $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; preg_match_all("/$regexp/siU", $string, $matches); // $matches[2] = array of link addresses // $matches[3] = array of link text - including HTML code echo "test"; print_r($matches); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XsDDb
function name:  (null)
number of ops:  15
compiled vars:  !0 = $string, !1 = $regexp, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Dit+is+een+link%3A+%3Ca+href%3D%22bla.html%22%3ETralalala%3C%2Fa%3E%2C+en+nog+eentje%3A+%3Ca+href%3D%22bla.htmlie%22%3ETralalala%3C%2Fa%3E'
    4     1        ASSIGN                                                   !1, '%3Ca%5Cs%5B%5E%3E%5D%2Ahref%3D%28%22%3F%3F%29%28%5B%5E%22+%3E%5D%2A%3F%29%5C1%5B%5E%3E%5D%2A%3E%28.%2A%29%3C%5C%2Fa%3E'
    5     2        INIT_FCALL                                               'preg_match_all'
          3        ROPE_INIT                                     3  ~6      '%2F'
          4        ROPE_ADD                                      1  ~6      ~6, !1
          5        ROPE_END                                      2  ~5      ~6, '%2FsiU'
          6        SEND_VAL                                                 ~5
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !2
          9        DO_ICALL                                                 
    8    10        ECHO                                                     'test'
    9    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   10    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.33 ms | 1386 KiB | 17 Q