3v4l.org

run code in 300+ PHP versions simultaneously
<?php function nxs_cURLTest($url, $msg, $testText){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); $response = curl_exec($ch); $errmsg = curl_error($ch); $cInfo = curl_getinfo($ch); curl_close($ch); echo "Testing ... ".$url." - ".$cInfo['url']."<br />"; if (stripos($response, $testText)!==false) echo "....".$msg." - OK<br />"; else { echo "....<b style='color:red;'>".$msg." - Problem</b><br /><pre>"; print_r($errmsg); print_r($cInfo); print_r(htmlentities($response)); echo "</pre>There is a problem with cURL. You need to contact your server admin or hosting provider."; } } nxs_cURLTest("http://www.google.com/intl/en/contact/", "HTTP to Google", "Mountain View, CA"); nxs_cURLTest("https://www.google.com/intl/en/contact/", "HTTPS to Google", "Mountain View, CA"); nxs_cURLTest("https://www.facebook.com/", "HTTPS to Facebook", 'id="facebook"'); nxs_cURLTest("https://www.linkedin.com/", "HTTPS to LinkedIn", 'link rel="canonical" href="https://www.linkedin.com/"'); nxs_cURLTest("https://twitter.com/", "HTTPS to Twitter", 'link rel="canonical" href="https://twitter.com/"'); nxs_cURLTest("http://pinterest.com/", "HTTPS to Pinterest", 'content="Pinterest"'); nxs_cURLTest("https://tumblr.com/", "HTTPS to Tumblr", 'content="Tumblr"'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/udTm7
function name:  (null)
number of ops:  36
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'nxs_curltest'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fcontact%2F'
          2        SEND_VAL                                                 'HTTP+to+Google'
          3        SEND_VAL                                                 'Mountain+View%2C+CA'
          4        DO_FCALL                                      0          
   26     5        INIT_FCALL                                               'nxs_curltest'
          6        SEND_VAL                                                 'https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fcontact%2F'
          7        SEND_VAL                                                 'HTTPS+to+Google'
          8        SEND_VAL                                                 'Mountain+View%2C+CA'
          9        DO_FCALL                                      0          
   27    10        INIT_FCALL                                               'nxs_curltest'
         11        SEND_VAL                                                 'https%3A%2F%2Fwww.facebook.com%2F'
         12        SEND_VAL                                                 'HTTPS+to+Facebook'
         13        SEND_VAL                                                 'id%3D%22facebook%22'
         14        DO_FCALL                                      0          
   28    15        INIT_FCALL                                               'nxs_curltest'
         16        SEND_VAL                                                 'https%3A%2F%2Fwww.linkedin.com%2F'
         17        SEND_VAL                                                 'HTTPS+to+LinkedIn'
         18        SEND_VAL                                                 'link+rel%3D%22canonical%22+href%3D%22https%3A%2F%2Fwww.linkedin.com%2F%22'
         19        DO_FCALL                                      0          
   29    20        INIT_FCALL                                               'nxs_curltest'
         21        SEND_VAL                                                 'https%3A%2F%2Ftwitter.com%2F'
         22        SEND_VAL                                                 'HTTPS+to+Twitter'
         23        SEND_VAL                                                 'link+rel%3D%22canonical%22+href%3D%22https%3A%2F%2Ftwitter.com%2F%22'
         24        DO_FCALL                                      0          
   30    25        INIT_FCALL                                               'nxs_curltest'
         26        SEND_VAL                                                 'http%3A%2F%2Fpinterest.com%2F'
         27        SEND_VAL                                                 'HTTPS+to+Pinterest'
         28        SEND_VAL                                                 'content%3D%22Pinterest%22'
         29        DO_FCALL                                      0          
   31    30        INIT_FCALL                                               'nxs_curltest'
         31        SEND_VAL                                                 'https%3A%2F%2Ftumblr.com%2F'
         32        SEND_VAL                                                 'HTTPS+to+Tumblr'
         33        SEND_VAL                                                 'content%3D%22Tumblr%22'
         34        DO_FCALL                                      0          
   32    35      > RETURN                                                   1

Function nxs_curltest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 67
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/udTm7
function name:  nxs_cURLTest
number of ops:  84
compiled vars:  !0 = $url, !1 = $msg, !2 = $testText, !3 = $ch, !4 = $response, !5 = $errmsg, !6 = $cInfo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        INIT_FCALL_BY_NAME                                       'curl_init'
          4        DO_FCALL                                      0  $7      
          5        ASSIGN                                                   !3, $7
    4     6        INIT_FCALL_BY_NAME                                       'curl_setopt'
          7        SEND_VAR_EX                                              !3
          8        FETCH_CONSTANT                                   ~9      'CURLOPT_URL'
          9        SEND_VAL_EX                                              ~9
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
    5    12        INIT_FCALL_BY_NAME                                       'curl_setopt'
         13        SEND_VAR_EX                                              !3
         14        FETCH_CONSTANT                                   ~11     'CURLOPT_USERAGENT'
         15        SEND_VAL_EX                                              ~11
         16        SEND_VAL_EX                                              'Mozilla%2F5.0+%28compatible%3B+MSIE+9.0%3B+Windows+NT+6.1%3B+WOW64%3B+Trident%2F5.0%29'
         17        DO_FCALL                                      0          
    6    18        INIT_FCALL_BY_NAME                                       'curl_setopt'
         19        SEND_VAR_EX                                              !3
         20        FETCH_CONSTANT                                   ~13     'CURLOPT_RETURNTRANSFER'
         21        SEND_VAL_EX                                              ~13
         22        SEND_VAL_EX                                              1
         23        DO_FCALL                                      0          
    7    24        INIT_FCALL_BY_NAME                                       'curl_setopt'
         25        SEND_VAR_EX                                              !3
         26        FETCH_CONSTANT                                   ~15     'CURLOPT_TIMEOUT'
         27        SEND_VAL_EX                                              ~15
         28        SEND_VAL_EX                                              10
         29        DO_FCALL                                      0          
    8    30        INIT_FCALL_BY_NAME                                       'curl_setopt'
         31        SEND_VAR_EX                                              !3
         32        FETCH_CONSTANT                                   ~17     'CURLOPT_CONNECTTIMEOUT'
         33        SEND_VAL_EX                                              ~17
         34        SEND_VAL_EX                                              10
         35        DO_FCALL                                      0          
    9    36        INIT_FCALL_BY_NAME                                       'curl_exec'
         37        SEND_VAR_EX                                              !3
         38        DO_FCALL                                      0  $19     
         39        ASSIGN                                                   !4, $19
   10    40        INIT_FCALL_BY_NAME                                       'curl_error'
         41        SEND_VAR_EX                                              !3
         42        DO_FCALL                                      0  $21     
         43        ASSIGN                                                   !5, $21
   11    44        INIT_FCALL_BY_NAME                                       'curl_getinfo'
         45        SEND_VAR_EX                                              !3
         46        DO_FCALL                                      0  $23     
         47        ASSIGN                                                   !6, $23
   12    48        INIT_FCALL_BY_NAME                                       'curl_close'
         49        SEND_VAR_EX                                              !3
         50        DO_FCALL                                      0          
   13    51        CONCAT                                           ~26     'Testing+...+', !0
         52        CONCAT                                           ~27     ~26, '+-+'
         53        FETCH_DIM_R                                      ~28     !6, 'url'
         54        CONCAT                                           ~29     ~27, ~28
         55        CONCAT                                           ~30     ~29, '%3Cbr+%2F%3E'
         56        ECHO                                                     ~30
   14    57        INIT_FCALL                                               'stripos'
         58        SEND_VAR                                                 !4
         59        SEND_VAR                                                 !2
         60        DO_ICALL                                         $31     
         61        TYPE_CHECK                                  1018          $31
         62      > JMPZ                                                     ~32, ->67
   15    63    >   CONCAT                                           ~33     '....', !1
         64        CONCAT                                           ~34     ~33, '+-+OK%3Cbr+%2F%3E'
         65        ECHO                                                     ~34
         66      > JMP                                                      ->83
   18    67    >   CONCAT                                           ~35     '....%3Cb+style%3D%27color%3Ared%3B%27%3E', !1
         68        CONCAT                                           ~36     ~35, '+-+Problem%3C%2Fb%3E%3Cbr+%2F%3E%3Cpre%3E'
         69        ECHO                                                     ~36
   19    70        INIT_FCALL                                               'print_r'
         71        SEND_VAR                                                 !5
         72        DO_ICALL                                                 
   20    73        INIT_FCALL                                               'print_r'
         74        SEND_VAR                                                 !6
         75        DO_ICALL                                                 
   21    76        INIT_FCALL                                               'print_r'
         77        INIT_FCALL                                               'htmlentities'
         78        SEND_VAR                                                 !4
         79        DO_ICALL                                         $39     
         80        SEND_VAR                                                 $39
         81        DO_ICALL                                                 
   22    82        ECHO                                                     '%3C%2Fpre%3EThere+is+a+problem+with+cURL.+You+need+to+contact+your+server+admin+or+hosting+provider.'
   24    83    > > RETURN                                                   null

End of function nxs_curltest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.26 ms | 1407 KiB | 26 Q