3v4l.org

run code in 300+ PHP versions simultaneously
<table border="1"> <tr> <th>Marca</th> <th>Modelo</th> </tr> <?php libxml_use_internal_errors(true); $html = new DOMDocument(); $url = "http://pt.bca-europe.com/SearchVehicle/SearchVehicleResults/?searchToken=null&currentPage=1&pageSize=200&sortOrder=TimeRemaining&saleId=00000000-0000-0000-0000-000000000000&saleCal=False&levelOfDetail=Detail&_=1385046541960#"; $html->loadHtmlFile($url); $xpath = new DOMXPath($html); $marcas = $xpath->query("//div[@id='VehicleResults']/div[@class='AspNet-GridView']/table/tbody/tr/td[@class='ConcatenatedField4']/span"); foreach($marcas as $marca) { $make = $xpath->query("./span[@class='Value Make']", $marca)->item(0)->textContent; $model = $xpath->query("./span[@class='Value Model']", $marca)->item(0)->textContent; echo "<tr><td>$make</td><td>$model</td></tr>\n"; } ?> </table>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 46
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 46
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
filename:       /in/bD0kj
function name:  (null)
number of ops:  49
compiled vars:  !0 = $html, !1 = $url, !2 = $xpath, !3 = $marcas, !4 = $marca, !5 = $make, !6 = $model
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Ctable+border%3D%221%22%3E%0A++%3Ctr%3E%0A++++%3Cth%3EMarca%3C%2Fth%3E%0A++++%3Cth%3EModelo%3C%2Fth%3E%0A++%3C%2Ftr%3E%0A++++'
    7     1        INIT_FCALL                                               'libxml_use_internal_errors'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                                 
    8     4        NEW                                              $8      'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $8
    9     7        ASSIGN                                                   !1, 'http%3A%2F%2Fpt.bca-europe.com%2FSearchVehicle%2FSearchVehicleResults%2F%3FsearchToken%3Dnull%26currentPage%3D1%26pageSize%3D200%26sortOrder%3DTimeRemaining%26saleId%3D00000000-0000-0000-0000-000000000000%26saleCal%3DFalse%26levelOfDetail%3DDetail%26_%3D1385046541960%23'
   10     8        INIT_METHOD_CALL                                         !0, 'loadHtmlFile'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
   11    11        NEW                                              $13     'DOMXPath'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $13
   12    15        INIT_METHOD_CALL                                         !2, 'query'
         16        SEND_VAL_EX                                              '%2F%2Fdiv%5B%40id%3D%27VehicleResults%27%5D%2Fdiv%5B%40class%3D%27AspNet-GridView%27%5D%2Ftable%2Ftbody%2Ftr%2Ftd%5B%40class%3D%27ConcatenatedField4%27%5D%2Fspan'
         17        DO_FCALL                                      0  $16     
         18        ASSIGN                                                   !3, $16
   13    19      > FE_RESET_R                                       $18     !3, ->46
         20    > > FE_FETCH_R                                               $18, !4, ->46
   14    21    >   INIT_METHOD_CALL                                         !2, 'query'
         22        SEND_VAL_EX                                              '.%2Fspan%5B%40class%3D%27Value+Make%27%5D'
         23        SEND_VAR_EX                                              !4
         24        DO_FCALL                                      0  $19     
         25        INIT_METHOD_CALL                                         $19, 'item'
         26        SEND_VAL_EX                                              0
         27        DO_FCALL                                      0  $20     
         28        FETCH_OBJ_R                                      ~21     $20, 'textContent'
         29        ASSIGN                                                   !5, ~21
   15    30        INIT_METHOD_CALL                                         !2, 'query'
         31        SEND_VAL_EX                                              '.%2Fspan%5B%40class%3D%27Value+Model%27%5D'
         32        SEND_VAR_EX                                              !4
         33        DO_FCALL                                      0  $23     
         34        INIT_METHOD_CALL                                         $23, 'item'
         35        SEND_VAL_EX                                              0
         36        DO_FCALL                                      0  $24     
         37        FETCH_OBJ_R                                      ~25     $24, 'textContent'
         38        ASSIGN                                                   !6, ~25
   16    39        ROPE_INIT                                     5  ~28     '%3Ctr%3E%3Ctd%3E'
         40        ROPE_ADD                                      1  ~28     ~28, !5
         41        ROPE_ADD                                      2  ~28     ~28, '%3C%2Ftd%3E%3Ctd%3E'
         42        ROPE_ADD                                      3  ~28     ~28, !6
         43        ROPE_END                                      4  ~27     ~28, '%3C%2Ftd%3E%3C%2Ftr%3E%0A'
         44        ECHO                                                     ~27
   13    45      > JMP                                                      ->20
         46    >   FE_FREE                                                  $18
   20    47        ECHO                                                     '%3C%2Ftable%3E'
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.09 ms | 1400 KiB | 15 Q