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); foreach ($out as $wert) { echo "Title: " . $wert[1] . "\n"; echo "Link: " . $wert[2] . "\n"; echo "Content: " . $wert[3] . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 31
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 31
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/0sdDk
function name:  (null)
number of ops:  33
compiled vars:  !0 = $returned_content, !1 = $order, !2 = $data, !3 = $out, !4 = $wert
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  $5      
          3        ASSIGN                                                   !0, $5
   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                                         $8      
         10        ASSIGN                                                   !2, $8
   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                                                 
   24    16      > FE_RESET_R                                       $11     !3, ->31
         17    > > FE_FETCH_R                                               $11, !4, ->31
   25    18    >   FETCH_DIM_R                                      ~12     !4, 1
         19        CONCAT                                           ~13     'Title%3A+', ~12
         20        CONCAT                                           ~14     ~13, '%0A'
         21        ECHO                                                     ~14
   26    22        FETCH_DIM_R                                      ~15     !4, 2
         23        CONCAT                                           ~16     'Link%3A+', ~15
         24        CONCAT                                           ~17     ~16, '%0A'
         25        ECHO                                                     ~17
   27    26        FETCH_DIM_R                                      ~18     !4, 3
         27        CONCAT                                           ~19     'Content%3A+', ~18
         28        CONCAT                                           ~20     ~19, '%0A'
         29        ECHO                                                     ~20
   24    30      > JMP                                                      ->17
         31    >   FE_FREE                                                  $11
   28    32      > RETURN                                                   1

Function get_data:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0sdDk
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:
157.22 ms | 1403 KiB | 18 Q