3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadHtml(' <tr class="ipl-zebra-list__item"> <td class="ipl-zebra-list__label">Official Sites</td> <td> <ul class="ipl-inline-list"> <li class="ipl-inline-list__item"> <a href="https://www.indiegogo.com/projects/super-troopers-2">IndieGoGo page</a> </li> <li class="ipl-inline-list__item"> <a href="https://www.facebook.com/SuperTroopersMovie/">Official site</a> </li> </ul> </td> </tr> ', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); $arr['sites1'] = []; foreach ($xpath->query("//li[@class=\"ipl-inline-list__item\"]/a") as $link) { $href = $link->getAttribute('href'); $arr['sites1'][] = $href; } print_r($arr['sites1']);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 26
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/KCfXCC
function name:  (null)
number of ops:  32
compiled vars:  !0 = $dom, !1 = $xpath, !2 = $arr, !3 = $link, !4 = $href
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $5      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    4     3        INIT_METHOD_CALL                                         !0, 'loadHtml'
          4        SEND_VAL_EX                                              '%0A%3Ctr+class%3D%22ipl-zebra-list__item%22%3E%0A++++%3Ctd+class%3D%22ipl-zebra-list__label%22%3EOfficial+Sites%3C%2Ftd%3E%0A++++%3Ctd%3E%0A++++++++%3Cul+class%3D%22ipl-inline-list%22%3E%0A++++++++++++%3Cli+class%3D%22ipl-inline-list__item%22%3E%0A++++++++++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.indiegogo.com%2Fprojects%2Fsuper-troopers-2%22%3EIndieGoGo+page%3C%2Fa%3E%0A++++++++++++%3C%2Fli%3E%0A++++++++++++%3Cli+class%3D%22ipl-inline-list__item%22%3E%0A++++++++++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.facebook.com%2FSuperTroopersMovie%2F%22%3EOfficial+site%3C%2Fa%3E%0A++++++++++++%3C%2Fli%3E%0A++++++++%3C%2Ful%3E%0A++++%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A'
   18     5        SEND_VAL_EX                                              8196
    4     6        DO_FCALL                                      0          
   20     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $9
   22    11        ASSIGN_DIM                                               !2, 'sites1'
         12        OP_DATA                                                  <array>
   23    13        INIT_METHOD_CALL                                         !1, 'query'
         14        SEND_VAL_EX                                              '%2F%2Fli%5B%40class%3D%22ipl-inline-list__item%22%5D%2Fa'
         15        DO_FCALL                                      0  $13     
         16      > FE_RESET_R                                       $14     $13, ->26
         17    > > FE_FETCH_R                                               $14, !3, ->26
   24    18    >   INIT_METHOD_CALL                                         !3, 'getAttribute'
         19        SEND_VAL_EX                                              'href'
         20        DO_FCALL                                      0  $15     
         21        ASSIGN                                                   !4, $15
   26    22        FETCH_DIM_W                                      $17     !2, 'sites1'
         23        ASSIGN_DIM                                               $17
         24        OP_DATA                                                  !4
   23    25      > JMP                                                      ->17
         26    >   FE_FREE                                                  $14
   29    27        INIT_FCALL                                               'print_r'
         28        FETCH_DIM_R                                      ~19     !2, 'sites1'
         29        SEND_VAL                                                 ~19
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
238.96 ms | 1005 KiB | 14 Q