3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://www.google.com/"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "postvar1=value1&postvar2=value2&postvar3=value3"); // in real life you should use something like: // curl_setopt($ch, CURLOPT_POSTFIELDS, // http_build_query(array('postvar1' => 'value1'))); // receive server response ... curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec ($ch); curl_close ($ch); // further processing .... if ($server_output == "OK") { print "OK"; } else { print "FAIL"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1TI9k
function name:  (null)
number of ops:  40
compiled vars:  !0 = $ch, !1 = $server_output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'curl_init'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
    4     3        INIT_FCALL_BY_NAME                                       'curl_setopt'
          4        SEND_VAR_EX                                              !0
          5        FETCH_CONSTANT                                   ~4      'CURLOPT_URL'
          6        SEND_VAL_EX                                              ~4
          7        SEND_VAL_EX                                              'http%3A%2F%2Fwww.google.com%2F'
          8        DO_FCALL                                      0          
    5     9        INIT_FCALL_BY_NAME                                       'curl_setopt'
         10        SEND_VAR_EX                                              !0
         11        FETCH_CONSTANT                                   ~6      'CURLOPT_POST'
         12        SEND_VAL_EX                                              ~6
         13        SEND_VAL_EX                                              1
         14        DO_FCALL                                      0          
    6    15        INIT_FCALL_BY_NAME                                       'curl_setopt'
         16        SEND_VAR_EX                                              !0
         17        FETCH_CONSTANT                                   ~8      'CURLOPT_POSTFIELDS'
         18        SEND_VAL_EX                                              ~8
    7    19        SEND_VAL_EX                                              'postvar1%3Dvalue1%26postvar2%3Dvalue2%26postvar3%3Dvalue3'
         20        DO_FCALL                                      0          
   13    21        INIT_FCALL_BY_NAME                                       'curl_setopt'
         22        SEND_VAR_EX                                              !0
         23        FETCH_CONSTANT                                   ~10     'CURLOPT_RETURNTRANSFER'
         24        SEND_VAL_EX                                              ~10
         25        SEND_VAL_EX                                              <true>
         26        DO_FCALL                                      0          
   15    27        INIT_FCALL_BY_NAME                                       'curl_exec'
         28        SEND_VAR_EX                                              !0
         29        DO_FCALL                                      0  $12     
         30        ASSIGN                                                   !1, $12
   17    31        INIT_FCALL_BY_NAME                                       'curl_close'
         32        SEND_VAR_EX                                              !0
         33        DO_FCALL                                      0          
   20    34        IS_EQUAL                                                 !1, 'OK'
         35      > JMPZ                                                     ~15, ->38
         36    >   ECHO                                                     'OK'
         37      > JMP                                                      ->39
         38    >   ECHO                                                     'FAIL'
   22    39    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.05 ms | 1386 KiB | 13 Q