3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/plaintext'); $url = 'http://www.pcdiga.com/2/12164/Motherboard-MSI-B85M-E45'; ///* function get_url_contents($url){ $crl = curl_init(); $timeout = 5; curl_setopt ($crl, CURLOPT_URL,$url); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); $ret = curl_exec($crl); curl_close($crl); return $ret; } //*/ //$page=file_get_contents($url); $page=get_url_contents($url); $price=preg_match("/span id\=\"preco_grelha\"\>(.*)<\/span\>/u", $page, $matches); print_r ($price); print ($matches); //print (); print ($page); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/psM0L
function name:  (null)
number of ops:  20
compiled vars:  !0 = $url, !1 = $page, !2 = $price, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-type%3A+text%2Fplaintext'
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, 'http%3A%2F%2Fwww.pcdiga.com%2F2%2F12164%2FMotherboard-MSI-B85M-E45'
   22     4        INIT_FCALL                                               'get_url_contents'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $6      
          7        ASSIGN                                                   !1, $6
   25     8        INIT_FCALL                                               'preg_match'
          9        SEND_VAL                                                 '%2Fspan+id%5C%3D%22preco_grelha%22%5C%3E%28.%2A%29%3C%5C%2Fspan%5C%3E%2Fu'
         10        SEND_VAR                                                 !1
         11        SEND_REF                                                 !3
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
   27    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
   28    17        ECHO                                                     !3
   30    18        ECHO                                                     !1
   31    19      > RETURN                                                   1

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

End of function get_url_contents

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.03 ms | 1403 KiB | 20 Q