3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(is_callable('curl_init')){ echo "Enabled"; } else { echo "Not enabled"; } $url = "https://www.google.com"; echo $url; $response = getPriceFromFlipkart($url); echo $response; function getPriceFromFlipkart($url) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 10.10; labnol;) 3v4l.org"); curl_setopt($curl, CURLOPT_FAILONERROR, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $html = curl_exec($curl); curl_close($curl); return $html; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9t4Vd
function name:  (null)
number of ops:  15
compiled vars:  !0 = $url, !1 = $response
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'is_callable'
          1        SEND_VAL                                                 'curl_init'
          2        DO_ICALL                                         $2      
          3      > JMPZ                                                     $2, ->6
    4     4    >   ECHO                                                     'Enabled'
          5      > JMP                                                      ->7
    8     6    >   ECHO                                                     'Not+enabled'
   11     7    >   ASSIGN                                                   !0, 'https%3A%2F%2Fwww.google.com'
   12     8        ECHO                                                     !0
   13     9        INIT_FCALL_BY_NAME                                       'getPriceFromFlipkart'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0  $4      
         12        ASSIGN                                                   !1, $4
   15    13        ECHO                                                     !1
   27    14      > RETURN                                                   1

Function getpricefromflipkart:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9t4Vd
function name:  getPriceFromFlipkart
number of ops:  38
compiled vars:  !0 = $url, !1 = $curl, !2 = $html
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   20     5        INIT_FCALL_BY_NAME                                       'curl_setopt'
          6        SEND_VAR_EX                                              !1
          7        FETCH_CONSTANT                                   ~5      'CURLOPT_USERAGENT'
          8        SEND_VAL_EX                                              ~5
          9        SEND_VAL_EX                                              'Mozilla%2F5.0+%28Windows%3B+U%3B+Windows+NT+10.10%3B+labnol%3B%29+3v4l.org'
         10        DO_FCALL                                      0          
   21    11        INIT_FCALL_BY_NAME                                       'curl_setopt'
         12        SEND_VAR_EX                                              !1
         13        FETCH_CONSTANT                                   ~7      'CURLOPT_FAILONERROR'
         14        SEND_VAL_EX                                              ~7
         15        SEND_VAL_EX                                              <true>
         16        DO_FCALL                                      0          
   22    17        INIT_FCALL_BY_NAME                                       'curl_setopt'
         18        SEND_VAR_EX                                              !1
         19        FETCH_CONSTANT                                   ~9      'CURLOPT_FOLLOWLOCATION'
         20        SEND_VAL_EX                                              ~9
         21        SEND_VAL_EX                                              <true>
         22        DO_FCALL                                      0          
   23    23        INIT_FCALL_BY_NAME                                       'curl_setopt'
         24        SEND_VAR_EX                                              !1
         25        FETCH_CONSTANT                                   ~11     'CURLOPT_RETURNTRANSFER'
         26        SEND_VAL_EX                                              ~11
         27        SEND_VAL_EX                                              <true>
         28        DO_FCALL                                      0          
   24    29        INIT_FCALL_BY_NAME                                       'curl_exec'
         30        SEND_VAR_EX                                              !1
         31        DO_FCALL                                      0  $13     
         32        ASSIGN                                                   !2, $13
   25    33        INIT_FCALL_BY_NAME                                       'curl_close'
         34        SEND_VAR_EX                                              !1
         35        DO_FCALL                                      0          
   26    36      > RETURN                                                   !2
   27    37*     > RETURN                                                   null

End of function getpricefromflipkart

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.37 ms | 1400 KiB | 15 Q