3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* gets the data from a URL */ function get_data($url) { $ch = curl_init(); $timeout = 5; 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); return $data; } $returned_content = get_data('http://www.wetteren.be/'); /* remove linefeed */ $order = array("\r\n", "\n", "\r"); $data = str_replace($order, '', $returned_content); preg_match_all("/<a class='title' href='(.*?)'>(.*?)<\/a>.*?<span class=\"detailKort\">(.*?)<\/span>/", $data, $out); $links = $out[1]; $titles = $out[2]; $content = $out[3]; for ($i = 0; $i <= count($links); $i++) { echo "Title:".$titles[$i]."\n"; echo "Link:".$links[$i]."\n"; echo "Content:".$content[$i]."\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 24
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 24
Branch analysis from position: 40
Branch analysis from position: 24
filename:       /in/A8pVk
function name:  (null)
number of ops:  41
compiled vars:  !0 = $returned_content, !1 = $order, !2 = $data, !3 = $out, !4 = $links, !5 = $titles, !6 = $content, !7 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'get_data'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.wetteren.be%2F'
          2        DO_FCALL                                      0  $8      
          3        ASSIGN                                                   !0, $8
   18     4        ASSIGN                                                   !1, <array>
   19     5        INIT_FCALL                                               'str_replace'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 ''
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !2, $11
   21    11        INIT_FCALL                                               'preg_match_all'
         12        SEND_VAL                                                 '%2F%3Ca+class%3D%27title%27+href%3D%27%28.%2A%3F%29%27%3E%28.%2A%3F%29%3C%5C%2Fa%3E.%2A%3F%3Cspan+class%3D%22detailKort%22%3E%28.%2A%3F%29%3C%5C%2Fspan%3E%2F'
         13        SEND_VAR                                                 !2
         14        SEND_REF                                                 !3
         15        DO_ICALL                                                 
   23    16        FETCH_DIM_R                                      ~14     !3, 1
         17        ASSIGN                                                   !4, ~14
   24    18        FETCH_DIM_R                                      ~16     !3, 2
         19        ASSIGN                                                   !5, ~16
   25    20        FETCH_DIM_R                                      ~18     !3, 3
         21        ASSIGN                                                   !6, ~18
   27    22        ASSIGN                                                   !7, 0
         23      > JMP                                                      ->37
   28    24    >   FETCH_DIM_R                                      ~21     !5, !7
         25        CONCAT                                           ~22     'Title%3A', ~21
         26        CONCAT                                           ~23     ~22, '%0A'
         27        ECHO                                                     ~23
   29    28        FETCH_DIM_R                                      ~24     !4, !7
         29        CONCAT                                           ~25     'Link%3A', ~24
         30        CONCAT                                           ~26     ~25, '%0A'
         31        ECHO                                                     ~26
   30    32        FETCH_DIM_R                                      ~27     !6, !7
         33        CONCAT                                           ~28     'Content%3A', ~27
         34        CONCAT                                           ~29     ~28, '%0A'
         35        ECHO                                                     ~29
   27    36        PRE_INC                                                  !7
         37    >   COUNT                                            ~31     !4
         38        IS_SMALLER_OR_EQUAL                                      !7, ~31
         39      > JMPNZ                                                    ~32, ->24
   31    40    > > RETURN                                                   1

Function get_data:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A8pVk
function name:  get_data
number of ops:  32
compiled vars:  !0 = $url, !1 = $ch, !2 = $timeout, !3 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        DO_FCALL                                      0  $4      
          3        ASSIGN                                                   !1, $4
    6     4        ASSIGN                                                   !2, 5
    7     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          
    8    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          
    9    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          
   10    23        INIT_FCALL_BY_NAME                                       'curl_exec'
         24        SEND_VAR_EX                                              !1
         25        DO_FCALL                                      0  $13     
         26        ASSIGN                                                   !3, $13
   11    27        INIT_FCALL_BY_NAME                                       'curl_close'
         28        SEND_VAR_EX                                              !1
         29        DO_FCALL                                      0          
   12    30      > RETURN                                                   !3
   13    31*     > RETURN                                                   null

End of function get_data

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.46 ms | 948 KiB | 19 Q