3v4l.org

run code in 300+ PHP versions simultaneously
<?php //set POST variables $url = 'http://domain.com/get-post.php'; $fields = array( 'lname'=>urlencode($last_name), 'fname'=>urlencode($first_name), 'email'=>urlencode($email) ); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); //execute post $result = curl_exec($ch); //close connection curl_close($ch);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/MQgpU
function name:  (null)
number of ops:  57
compiled vars:  !0 = $url, !1 = $fields, !2 = $last_name, !3 = $first_name, !4 = $email, !5 = $value, !6 = $key, !7 = $fields_string, !8 = $ch, !9 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fdomain.com%2Fget-post.php'
    5     1        INIT_FCALL                                               'urlencode'
          2        SEND_VAR                                                 !2
          3        DO_ICALL                                         $11     
          4        INIT_ARRAY                                       ~12     $11, 'lname'
    6     5        INIT_FCALL                                               'urlencode'
          6        SEND_VAR                                                 !3
          7        DO_ICALL                                         $13     
          8        ADD_ARRAY_ELEMENT                                ~12     $13, 'fname'
    7     9        INIT_FCALL                                               'urlencode'
         10        SEND_VAR                                                 !4
         11        DO_ICALL                                         $14     
         12        ADD_ARRAY_ELEMENT                                ~12     $14, 'email'
    4    13        ASSIGN                                                   !1, ~12
   11    14      > FE_RESET_R                                       $16     !1, ->22
         15    > > FE_FETCH_R                                       ~17     $16, !5, ->22
         16    >   ASSIGN                                                   !6, ~17
         17        CONCAT                                           ~19     !6, '%3D'
         18        CONCAT                                           ~20     ~19, !5
         19        CONCAT                                           ~21     ~20, '%26'
         20        ASSIGN_OP                                     8          !7, ~21
         21      > JMP                                                      ->15
         22    >   FE_FREE                                                  $16
   12    23        INIT_FCALL                                               'rtrim'
         24        SEND_VAR                                                 !7
         25        SEND_VAL                                                 '%26'
         26        DO_ICALL                                                 
   15    27        INIT_FCALL_BY_NAME                                       'curl_init'
         28        DO_FCALL                                      0  $24     
         29        ASSIGN                                                   !8, $24
   18    30        INIT_FCALL_BY_NAME                                       'curl_setopt'
         31        SEND_VAR_EX                                              !8
         32        FETCH_CONSTANT                                   ~26     'CURLOPT_URL'
         33        SEND_VAL_EX                                              ~26
         34        SEND_VAR_EX                                              !0
         35        DO_FCALL                                      0          
   19    36        INIT_FCALL_BY_NAME                                       'curl_setopt'
         37        SEND_VAR_EX                                              !8
         38        FETCH_CONSTANT                                   ~28     'CURLOPT_POST'
         39        SEND_VAL_EX                                              ~28
         40        COUNT                                            ~29     !1
         41        SEND_VAL_EX                                              ~29
         42        DO_FCALL                                      0          
   20    43        INIT_FCALL_BY_NAME                                       'curl_setopt'
         44        SEND_VAR_EX                                              !8
         45        FETCH_CONSTANT                                   ~31     'CURLOPT_POSTFIELDS'
         46        SEND_VAL_EX                                              ~31
         47        SEND_VAR_EX                                              !7
         48        DO_FCALL                                      0          
   23    49        INIT_FCALL_BY_NAME                                       'curl_exec'
         50        SEND_VAR_EX                                              !8
         51        DO_FCALL                                      0  $33     
         52        ASSIGN                                                   !9, $33
   26    53        INIT_FCALL_BY_NAME                                       'curl_close'
         54        SEND_VAR_EX                                              !8
         55        DO_FCALL                                      0          
         56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.4 ms | 1400 KiB | 17 Q