3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://beta.congress.gov/search?pageSort=dateOfIntroduction%3Adesc&q={%22congress%22%3A%22112|113|111|110|109|108|107|106%22%2C%22source%22%3A%22legislation%22}&pageSize=25'; libxml_use_internal_errors(true); $dom = new DOMDocument; $dom->loadHTMLFile($url); header('content-type: text/plain'); $xpath = new DOMXPath($dom); $found = $xpath->query('//ul[@class="results_list"]/li'); $results = array(); foreach ($found as $li) { $bill = $xpath->query('h2/a', $li); $bill_name = $bill->item(0)->nodeValue; $bill_url = $bill->item(0)->getAttribute('href'); $sponsor = $xpath->query('table/tbody/tr/td/a', $li); $sponsor_name = $sponsor->item(0)->nodeValue; $sponsor_url = $sponsor->item(0)->getAttribute('href'); $results[] = array( $bill_name => $bill_url, $sponsor_name => $sponsor_url ); } var_dump($results);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 63
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 63
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 63
filename:       /in/XDqLS
function name:  (null)
number of ops:  68
compiled vars:  !0 = $url, !1 = $dom, !2 = $xpath, !3 = $found, !4 = $results, !5 = $li, !6 = $bill, !7 = $bill_name, !8 = $bill_url, !9 = $sponsor, !10 = $sponsor_name, !11 = $sponsor_url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fbeta.congress.gov%2Fsearch%3FpageSort%3DdateOfIntroduction%253Adesc%26q%3D%7B%2522congress%2522%253A%2522112%7C113%7C111%7C110%7C109%7C108%7C107%7C106%2522%252C%2522source%2522%253A%2522legislation%2522%7D%26pageSize%3D25'
    5     1        INIT_FCALL                                               'libxml_use_internal_errors'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                                 
    6     4        NEW                                              $14     'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $14
    7     7        INIT_METHOD_CALL                                         !1, 'loadHTMLFile'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
    9    10        INIT_FCALL                                               'header'
         11        SEND_VAL                                                 'content-type%3A+text%2Fplain'
         12        DO_ICALL                                                 
   11    13        NEW                                              $19     'DOMXPath'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !2, $19
   12    17        INIT_METHOD_CALL                                         !2, 'query'
         18        SEND_VAL_EX                                              '%2F%2Ful%5B%40class%3D%22results_list%22%5D%2Fli'
         19        DO_FCALL                                      0  $22     
         20        ASSIGN                                                   !3, $22
   14    21        ASSIGN                                                   !4, <array>
   15    22      > FE_RESET_R                                       $25     !3, ->63
         23    > > FE_FETCH_R                                               $25, !5, ->63
   17    24    >   INIT_METHOD_CALL                                         !2, 'query'
         25        SEND_VAL_EX                                              'h2%2Fa'
         26        SEND_VAR_EX                                              !5
         27        DO_FCALL                                      0  $26     
         28        ASSIGN                                                   !6, $26
   18    29        INIT_METHOD_CALL                                         !6, 'item'
         30        SEND_VAL_EX                                              0
         31        DO_FCALL                                      0  $28     
         32        FETCH_OBJ_R                                      ~29     $28, 'nodeValue'
         33        ASSIGN                                                   !7, ~29
   19    34        INIT_METHOD_CALL                                         !6, 'item'
         35        SEND_VAL_EX                                              0
         36        DO_FCALL                                      0  $31     
         37        INIT_METHOD_CALL                                         $31, 'getAttribute'
         38        SEND_VAL_EX                                              'href'
         39        DO_FCALL                                      0  $32     
         40        ASSIGN                                                   !8, $32
   21    41        INIT_METHOD_CALL                                         !2, 'query'
         42        SEND_VAL_EX                                              'table%2Ftbody%2Ftr%2Ftd%2Fa'
         43        SEND_VAR_EX                                              !5
         44        DO_FCALL                                      0  $34     
         45        ASSIGN                                                   !9, $34
   22    46        INIT_METHOD_CALL                                         !9, 'item'
         47        SEND_VAL_EX                                              0
         48        DO_FCALL                                      0  $36     
         49        FETCH_OBJ_R                                      ~37     $36, 'nodeValue'
         50        ASSIGN                                                   !10, ~37
   23    51        INIT_METHOD_CALL                                         !9, 'item'
         52        SEND_VAL_EX                                              0
         53        DO_FCALL                                      0  $39     
         54        INIT_METHOD_CALL                                         $39, 'getAttribute'
         55        SEND_VAL_EX                                              'href'
         56        DO_FCALL                                      0  $40     
         57        ASSIGN                                                   !11, $40
   26    58        INIT_ARRAY                                       ~43     !8, !7
   27    59        ADD_ARRAY_ELEMENT                                ~43     !11, !10
   25    60        ASSIGN_DIM                                               !4
   27    61        OP_DATA                                                  ~43
   15    62      > JMP                                                      ->23
         63    >   FE_FREE                                                  $25
   31    64        INIT_FCALL                                               'var_dump'
         65        SEND_VAR                                                 !4
         66        DO_ICALL                                                 
         67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.6 ms | 1400 KiB | 19 Q