3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = "/(?<=href=(\"|'))[^\"']+(?=(\"|'))/"; $string = "<a class=\"hola\" href=\"link1\">Hola qué tal 1</a>"; $string .= "<a class=\'hola\' href=\'link2\'>Hola qué tal 2</a>"; $string .= "<a class=\"hola\" href=\"link3\">Hola qué tal 3</a>"; $string .= "<a class=\"hola\" href=\"link4\">Hola qué tal 4</a>"; $html = file_get_html($string); foreach($html->find('a') as $link) { echo $link->href . '<br />'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/SsRT0
function name:  (null)
number of ops:  20
compiled vars:  !0 = $pattern, !1 = $string, !2 = $html, !3 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2F%28%3F%3C%3Dhref%3D%28%22%7C%27%29%29%5B%5E%22%27%5D%2B%28%3F%3D%28%22%7C%27%29%29%2F'
    3     1        ASSIGN                                                   !1, '%3Ca+class%3D%22hola%22+href%3D%22link1%22%3EHola+qu%C3%A9+tal+1%3C%2Fa%3E'
    4     2        ASSIGN_OP                                     8          !1, '%3Ca+class%3D%5C%27hola%5C%27+href%3D%5C%27link2%5C%27%3EHola+qu%C3%A9+tal+2%3C%2Fa%3E'
    5     3        ASSIGN_OP                                     8          !1, '%3Ca+class%3D%22hola%22+href%3D%22link3%22%3EHola+qu%C3%A9+tal+3%3C%2Fa%3E'
    6     4        ASSIGN_OP                                     8          !1, '%3Ca+class%3D%22hola%22+href%3D%22link4%22%3EHola+qu%C3%A9+tal+4%3C%2Fa%3E'
    7     5        INIT_FCALL_BY_NAME                                       'file_get_html'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !2, $9
    9     9        INIT_METHOD_CALL                                         !2, 'find'
         10        SEND_VAL_EX                                              'a'
         11        DO_FCALL                                      0  $11     
         12      > FE_RESET_R                                       $12     $11, ->18
         13    > > FE_FETCH_R                                               $12, !3, ->18
   10    14    >   FETCH_OBJ_R                                      ~13     !3, 'href'
         15        CONCAT                                           ~14     ~13, '%3Cbr+%2F%3E'
         16        ECHO                                                     ~14
    9    17      > JMP                                                      ->13
         18    >   FE_FREE                                                  $12
   11    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.93 ms | 1394 KiB | 13 Q