3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getHTTPInfo($url, $followLocation = false) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_NOBODY, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_MAXREDIRS, 5); curl_setopt($curl, CURLOPT_TIMEOUT, 30); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, $followLocation); curl_exec($curl); $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); $effectiveURL = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); curl_close($curl); return array('http_code' => $httpStatus, 'effective_url' => $effectiveURL); } $result = getHTTPInfo('http://plantpath.unl.edu/', true); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/isM5l
function name:  (null)
number of ops:  9
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'gethttpinfo'
          1        SEND_VAL                                                 'http%3A%2F%2Fplantpath.unl.edu%2F'
          2        SEND_VAL                                                 <true>
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
   25     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function gethttpinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/isM5l
function name:  getHTTPInfo
number of ops:  58
compiled vars:  !0 = $url, !1 = $followLocation, !2 = $curl, !3 = $httpStatus, !4 = $effectiveURL
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
    4     2        INIT_FCALL_BY_NAME                                       'curl_init'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !2, $5
    6     6        INIT_FCALL_BY_NAME                                       'curl_setopt'
          7        SEND_VAR_EX                                              !2
          8        FETCH_CONSTANT                                   ~7      'CURLOPT_NOBODY'
          9        SEND_VAL_EX                                              ~7
         10        SEND_VAL_EX                                              <true>
         11        DO_FCALL                                      0          
    7    12        INIT_FCALL_BY_NAME                                       'curl_setopt'
         13        SEND_VAR_EX                                              !2
         14        FETCH_CONSTANT                                   ~9      'CURLOPT_SSL_VERIFYPEER'
         15        SEND_VAL_EX                                              ~9
         16        SEND_VAL_EX                                              <false>
         17        DO_FCALL                                      0          
    8    18        INIT_FCALL_BY_NAME                                       'curl_setopt'
         19        SEND_VAR_EX                                              !2
         20        FETCH_CONSTANT                                   ~11     'CURLOPT_MAXREDIRS'
         21        SEND_VAL_EX                                              ~11
         22        SEND_VAL_EX                                              5
         23        DO_FCALL                                      0          
    9    24        INIT_FCALL_BY_NAME                                       'curl_setopt'
         25        SEND_VAR_EX                                              !2
         26        FETCH_CONSTANT                                   ~13     'CURLOPT_TIMEOUT'
         27        SEND_VAL_EX                                              ~13
         28        SEND_VAL_EX                                              30
         29        DO_FCALL                                      0          
   10    30        INIT_FCALL_BY_NAME                                       'curl_setopt'
         31        SEND_VAR_EX                                              !2
         32        FETCH_CONSTANT                                   ~15     'CURLOPT_FOLLOWLOCATION'
         33        SEND_VAL_EX                                              ~15
         34        SEND_VAR_EX                                              !1
         35        DO_FCALL                                      0          
   12    36        INIT_FCALL_BY_NAME                                       'curl_exec'
         37        SEND_VAR_EX                                              !2
         38        DO_FCALL                                      0          
   14    39        INIT_FCALL_BY_NAME                                       'curl_getinfo'
         40        SEND_VAR_EX                                              !2
         41        FETCH_CONSTANT                                   ~18     'CURLINFO_HTTP_CODE'
         42        SEND_VAL_EX                                              ~18
         43        DO_FCALL                                      0  $19     
         44        ASSIGN                                                   !3, $19
   15    45        INIT_FCALL_BY_NAME                                       'curl_getinfo'
         46        SEND_VAR_EX                                              !2
         47        FETCH_CONSTANT                                   ~21     'CURLINFO_EFFECTIVE_URL'
         48        SEND_VAL_EX                                              ~21
         49        DO_FCALL                                      0  $22     
         50        ASSIGN                                                   !4, $22
   17    51        INIT_FCALL_BY_NAME                                       'curl_close'
         52        SEND_VAR_EX                                              !2
         53        DO_FCALL                                      0          
   19    54        INIT_ARRAY                                       ~25     !3, 'http_code'
   20    55        ADD_ARRAY_ELEMENT                                ~25     !4, 'effective_url'
         56      > RETURN                                                   ~25
   21    57*     > RETURN                                                   null

End of function gethttpinfo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.45 ms | 1403 KiB | 16 Q