3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html=<<<HTML <h1><a href="http://www.website.com/article/slug-that-has-undetermined-amount-of-hyphens/12345">Whatever</a></h1> <p>Here is a url as plain text: http://www.website.com/article/sluggy-slug</p> <div>Here is a qualifying link: <a href="http://www.website.com/article/slugger-sluggington-jr/666">Whatever</a></div> HTML; $dom = new DomDocument(); $dom->loadHTML($html); foreach ($dom->getElementsByTagName('a') as $item) { $output[] = $item->getAttribute('href'); } var_export($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/KTZDS
function name:  (null)
number of ops:  23
compiled vars:  !0 = $html, !1 = $dom, !2 = $item, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ch1%3E%3Ca+href%3D%22http%3A%2F%2Fwww.website.com%2Farticle%2Fslug-that-has-undetermined-amount-of-hyphens%2F12345%22%3EWhatever%3C%2Fa%3E%3C%2Fh1%3E%0A%3Cp%3EHere+is+a+url+as+plain+text%3A+http%3A%2F%2Fwww.website.com%2Farticle%2Fsluggy-slug%3C%2Fp%3E%0A%3Cdiv%3EHere+is+a+qualifying+link%3A+%3Ca+href%3D%22http%3A%2F%2Fwww.website.com%2Farticle%2Fslugger-sluggington-jr%2F666%22%3EWhatever%3C%2Fa%3E%3C%2Fdiv%3E'
    8     1        NEW                                              $5      'DomDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    9     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   10     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'a'
          9        DO_FCALL                                      0  $9      
         10      > FE_RESET_R                                       $10     $9, ->18
         11    > > FE_FETCH_R                                               $10, !2, ->18
   11    12    >   INIT_METHOD_CALL                                         !2, 'getAttribute'
         13        SEND_VAL_EX                                              'href'
         14        DO_FCALL                                      0  $12     
         15        ASSIGN_DIM                                               !3
         16        OP_DATA                                                  $12
   10    17      > JMP                                                      ->11
         18    >   FE_FREE                                                  $10
   13    19        INIT_FCALL                                               'var_export'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.48 ms | 1014 KiB | 14 Q