3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Send a POST requst using cURL * @param string $url to request * @param array $post values to send * @param array $options for cURL * @return string */ function curl_post($url, array $post = NULL) { $defaults = array( CURLOPT_POST => 1, CURLOPT_HEADER => 0, CURLOPT_URL => $url, CURLOPT_FRESH_CONNECT => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FORBID_REUSE => 1, CURLOPT_TIMEOUT => 4, CURLOPT_POSTFIELDS => http_build_query($post) ); $ch = curl_init(); curl_setopt_array($ch, ($defaults)); if( ! $result = curl_exec($ch)) { trigger_error(curl_error($ch)); } curl_close($ch); return $result; } $ul = "http://localhost:8080/admin-app/service/sites/1/providers"; $reopt = array(); $postdata = array('key' => 'jHsYiWWRZDq5Sq3N'); $resp = curl_post($ul, $postdata, $reopt); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6IWfF
function name:  (null)
number of ops:  10
compiled vars:  !0 = $ul, !1 = $reopt, !2 = $postdata, !3 = $resp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Flocalhost%3A8080%2Fadmin-app%2Fservice%2Fsites%2F1%2Fproviders'
   33     1        ASSIGN                                                   !1, <array>
   34     2        ASSIGN                                                   !2, <array>
   35     3        INIT_FCALL                                               'curl_post'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !3, $7
   39     9      > RETURN                                                   1

Function curl_post:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 41
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/6IWfF
function name:  curl_post
number of ops:  46
compiled vars:  !0 = $url, !1 = $post, !2 = $defaults, !3 = $ch, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
   12     2        FETCH_CONSTANT                                   ~5      'CURLOPT_POST'
          3        INIT_ARRAY                                       ~6      1, ~5
   13     4        FETCH_CONSTANT                                   ~7      'CURLOPT_HEADER'
          5        ADD_ARRAY_ELEMENT                                ~6      0, ~7
   14     6        FETCH_CONSTANT                                   ~8      'CURLOPT_URL'
          7        ADD_ARRAY_ELEMENT                                ~6      !0, ~8
   15     8        FETCH_CONSTANT                                   ~9      'CURLOPT_FRESH_CONNECT'
          9        ADD_ARRAY_ELEMENT                                ~6      1, ~9
   16    10        FETCH_CONSTANT                                   ~10     'CURLOPT_RETURNTRANSFER'
         11        ADD_ARRAY_ELEMENT                                ~6      1, ~10
   17    12        FETCH_CONSTANT                                   ~11     'CURLOPT_FORBID_REUSE'
         13        ADD_ARRAY_ELEMENT                                ~6      1, ~11
   18    14        FETCH_CONSTANT                                   ~12     'CURLOPT_TIMEOUT'
         15        ADD_ARRAY_ELEMENT                                ~6      4, ~12
   19    16        FETCH_CONSTANT                                   ~13     'CURLOPT_POSTFIELDS'
         17        INIT_FCALL                                               'http_build_query'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $14     
         20        ADD_ARRAY_ELEMENT                                ~6      $14, ~13
   11    21        ASSIGN                                                   !2, ~6
   22    22        INIT_FCALL_BY_NAME                                       'curl_init'
         23        DO_FCALL                                      0  $16     
         24        ASSIGN                                                   !3, $16
   23    25        INIT_FCALL_BY_NAME                                       'curl_setopt_array'
         26        SEND_VAR_EX                                              !3
         27        SEND_VAR_EX                                              !2
         28        DO_FCALL                                      0          
   24    29        INIT_FCALL_BY_NAME                                       'curl_exec'
         30        SEND_VAR_EX                                              !3
         31        DO_FCALL                                      0  $19     
         32        ASSIGN                                           ~20     !4, $19
         33        BOOL_NOT                                         ~21     ~20
         34      > JMPZ                                                     ~21, ->41
   26    35    >   INIT_FCALL                                               'trigger_error'
         36        INIT_FCALL_BY_NAME                                       'curl_error'
         37        SEND_VAR_EX                                              !3
         38        DO_FCALL                                      0  $22     
         39        SEND_VAR                                                 $22
         40        DO_ICALL                                                 
   28    41    >   INIT_FCALL_BY_NAME                                       'curl_close'
         42        SEND_VAR_EX                                              !3
         43        DO_FCALL                                      0          
   29    44      > RETURN                                                   !4
   30    45*     > RETURN                                                   null

End of function curl_post

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.05 ms | 1403 KiB | 18 Q