3v4l.org

run code in 300+ PHP versions simultaneously
<?php grab_content('http://www.metano-logistics.com/metano_olm/assets/view_asset.php?id=17876&page_mode=2009'); $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $results = $xpath->query("//div[@class='tabbed_container']"); $content_array = array(); if ($results->length > 0) { $dom->saveXML($results->item(0)); //exit; for($i=0;$i<5;$i++){ $content_array[] = $dom->saveXML($results->item($i)); } } function grab_content($url){ $ch = curl_init(); $timeout = 50; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); print_r($data); return $data; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 40
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 29
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 29
Branch analysis from position: 40
Branch analysis from position: 29
Branch analysis from position: 40
filename:       /in/7cd4A
function name:  (null)
number of ops:  41
compiled vars:  !0 = $dom, !1 = $html, !2 = $xpath, !3 = $results, !4 = $content_array, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'grab_content'
          1        SEND_VAL_EX                                              'http%3A%2F%2Fwww.metano-logistics.com%2Fmetano_olm%2Fassets%2Fview_asset.php%3Fid%3D17876%26page_mode%3D2009'
          2        DO_FCALL                                      0          
    4     3        NEW                                              $7      'DOMDocument'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $7
    5     6        INIT_METHOD_CALL                                         !0, 'loadHTML'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
    6     9        NEW                                              $11     'DOMXPath'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $11
    7    13        INIT_METHOD_CALL                                         !2, 'query'
         14        SEND_VAL_EX                                              '%2F%2Fdiv%5B%40class%3D%27tabbed_container%27%5D'
         15        DO_FCALL                                      0  $14     
         16        ASSIGN                                                   !3, $14
    9    17        ASSIGN                                                   !4, <array>
   11    18        FETCH_OBJ_R                                      ~17     !3, 'length'
         19        IS_SMALLER                                               0, ~17
         20      > JMPZ                                                     ~18, ->40
   13    21    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         22        INIT_METHOD_CALL                                         !3, 'item'
         23        SEND_VAL_EX                                              0
         24        DO_FCALL                                      0  $19     
         25        SEND_VAR_NO_REF_EX                                       $19
         26        DO_FCALL                                      0          
   15    27        ASSIGN                                                   !5, 0
         28      > JMP                                                      ->38
   16    29    >   INIT_METHOD_CALL                                         !0, 'saveXML'
         30        INIT_METHOD_CALL                                         !3, 'item'
         31        SEND_VAR_EX                                              !5
         32        DO_FCALL                                      0  $23     
         33        SEND_VAR_NO_REF_EX                                       $23
         34        DO_FCALL                                      0  $24     
         35        ASSIGN_DIM                                               !4
         36        OP_DATA                                                  $24
   15    37        PRE_INC                                                  !5
         38    >   IS_SMALLER                                               !5, 5
         39      > JMPNZ                                                    ~26, ->29
   35    40    > > RETURN                                                   1

Function grab_content:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7cd4A
function name:  grab_content
number of ops:  35
compiled vars:  !0 = $url, !1 = $ch, !2 = $timeout, !3 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        DO_FCALL                                      0  $4      
          3        ASSIGN                                                   !1, $4
   26     4        ASSIGN                                                   !2, 50
   27     5        INIT_FCALL_BY_NAME                                       'curl_setopt'
          6        SEND_VAR_EX                                              !1
          7        FETCH_CONSTANT                                   ~7      'CURLOPT_URL'
          8        SEND_VAL_EX                                              ~7
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   28    11        INIT_FCALL_BY_NAME                                       'curl_setopt'
         12        SEND_VAR_EX                                              !1
         13        FETCH_CONSTANT                                   ~9      'CURLOPT_RETURNTRANSFER'
         14        SEND_VAL_EX                                              ~9
         15        SEND_VAL_EX                                              1
         16        DO_FCALL                                      0          
   29    17        INIT_FCALL_BY_NAME                                       'curl_setopt'
         18        SEND_VAR_EX                                              !1
         19        FETCH_CONSTANT                                   ~11     'CURLOPT_CONNECTTIMEOUT'
         20        SEND_VAL_EX                                              ~11
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0          
   30    23        INIT_FCALL_BY_NAME                                       'curl_exec'
         24        SEND_VAR_EX                                              !1
         25        DO_FCALL                                      0  $13     
         26        ASSIGN                                                   !3, $13
   31    27        INIT_FCALL_BY_NAME                                       'curl_close'
         28        SEND_VAR_EX                                              !1
         29        DO_FCALL                                      0          
   33    30        INIT_FCALL                                               'print_r'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                                 
   34    33      > RETURN                                                   !3
   35    34*     > RETURN                                                   null

End of function grab_content

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.87 ms | 1392 KiB | 15 Q