3v4l.org

run code in 300+ PHP versions simultaneously
<?php function file_get_the_contents($url) { $ch = curl_init(); $timeout = 10; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); return $file_contents; } $text = file_get_the_contents('http://www.nu.nl/') ; // scrape page into variable preg_match ('/<fieldset id="zoek">([^`]*?)</fieldset>/', $text, $temp); // get data out of the page echo htmlentities($temp[0]) ; // spits out the 1st occurance of your data echo 'test'; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Yl82
function name:  (null)
number of ops:  16
compiled vars:  !0 = $text, !1 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'file_get_the_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.nu.nl%2F'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   15     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2F%3Cfieldset+id%3D%22zoek%22%3E%28%5B%5E%60%5D%2A%3F%29%3C%2Ffieldset%3E%2F'
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !1
          8        DO_ICALL                                                 
   16     9        INIT_FCALL                                               'htmlentities'
         10        FETCH_DIM_R                                      ~5      !1, 0
         11        SEND_VAL                                                 ~5
         12        DO_ICALL                                         $6      
         13        ECHO                                                     $6
   18    14        ECHO                                                     'test'
   19    15      > RETURN                                                   1

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

End of function file_get_the_contents

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.48 ms | 1403 KiB | 18 Q