3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Send POST request to https://secure.example.com/form_action.php * Include form elements named "foo" and "bar" with dummy values */ $sock = fsockopen("ssl://secure.example.com", 443, $errno, $errstr, 30); if (!$sock) die("$errstr ($errno)\n"); $data = "foo=" . urlencode("Value for Foo") . "&bar=" . urlencode("Value for Bar"); fwrite($sock, "POST /form_action.php HTTP/1.0\r\n"); fwrite($sock, "Host: secure.example.com\r\n"); fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n"); fwrite($sock, "Content-length: " . strlen($data) . "\r\n"); fwrite($sock, "Accept: */*\r\n"); fwrite($sock, "\r\n"); fwrite($sock, $data); $headers = ""; while ($str = trim(fgets($sock, 4096))) $headers .= "$str\n"; echo "\n"; $body = ""; while (!feof($sock)) $body .= fgets($sock, 4096); fclose($sock); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 58
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 78
Branch analysis from position: 78
2 jumps found. (Code = 44) Position 1 = 83, Position 2 = 73
Branch analysis from position: 83
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
2 jumps found. (Code = 44) Position 1 = 83, Position 2 = 73
Branch analysis from position: 83
Branch analysis from position: 73
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 58
Branch analysis from position: 70
Branch analysis from position: 58
filename:       /in/H16gS
function name:  (null)
number of ops:  87
compiled vars:  !0 = $sock, !1 = $errno, !2 = $errstr, !3 = $data, !4 = $headers, !5 = $str, !6 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'fsockopen'
          1        SEND_VAL                                                 'ssl%3A%2F%2Fsecure.example.com'
          2        SEND_VAL                                                 443
          3        SEND_REF                                                 !1
          4        SEND_REF                                                 !2
          5        SEND_VAL                                                 30
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !0, $7
    7     8        BOOL_NOT                                         ~9      !0
          9      > JMPZ                                                     ~9, ->15
         10    >   ROPE_INIT                                     4  ~11     !2
         11        ROPE_ADD                                      1  ~11     ~11, '+%28'
         12        ROPE_ADD                                      2  ~11     ~11, !1
         13        ROPE_END                                      3  ~10     ~11, '%29%0A'
         14      > EXIT                                                     ~10
    9    15    >   INIT_FCALL                                               'urlencode'
         16        SEND_VAL                                                 'Value+for+Foo'
         17        DO_ICALL                                         $13     
         18        CONCAT                                           ~14     'foo%3D', $13
         19        CONCAT                                           ~15     ~14, '%26bar%3D'
         20        INIT_FCALL                                               'urlencode'
         21        SEND_VAL                                                 'Value+for+Bar'
         22        DO_ICALL                                         $16     
         23        CONCAT                                           ~17     ~15, $16
         24        ASSIGN                                                   !3, ~17
   11    25        INIT_FCALL                                               'fwrite'
         26        SEND_VAR                                                 !0
         27        SEND_VAL                                                 'POST+%2Fform_action.php+HTTP%2F1.0%0D%0A'
         28        DO_ICALL                                                 
   12    29        INIT_FCALL                                               'fwrite'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 'Host%3A+secure.example.com%0D%0A'
         32        DO_ICALL                                                 
   13    33        INIT_FCALL                                               'fwrite'
         34        SEND_VAR                                                 !0
         35        SEND_VAL                                                 'Content-type%3A+application%2Fx-www-form-urlencoded%0D%0A'
         36        DO_ICALL                                                 
   14    37        INIT_FCALL                                               'fwrite'
         38        SEND_VAR                                                 !0
         39        STRLEN                                           ~22     !3
         40        CONCAT                                           ~23     'Content-length%3A+', ~22
         41        CONCAT                                           ~24     ~23, '%0D%0A'
         42        SEND_VAL                                                 ~24
         43        DO_ICALL                                                 
   15    44        INIT_FCALL                                               'fwrite'
         45        SEND_VAR                                                 !0
         46        SEND_VAL                                                 'Accept%3A+%2A%2F%2A%0D%0A'
         47        DO_ICALL                                                 
   16    48        INIT_FCALL                                               'fwrite'
         49        SEND_VAR                                                 !0
         50        SEND_VAL                                                 '%0D%0A'
         51        DO_ICALL                                                 
   17    52        INIT_FCALL                                               'fwrite'
         53        SEND_VAR                                                 !0
         54        SEND_VAR                                                 !3
         55        DO_ICALL                                                 
   19    56        ASSIGN                                                   !4, ''
   20    57      > JMP                                                      ->61
   21    58    >   NOP                                                      
         59        FAST_CONCAT                                      ~30     !5, '%0A'
         60        ASSIGN_OP                                     8          !4, ~30
   20    61    >   INIT_FCALL                                               'trim'
         62        INIT_FCALL                                               'fgets'
         63        SEND_VAR                                                 !0
         64        SEND_VAL                                                 4096
         65        DO_ICALL                                         $32     
         66        SEND_VAR                                                 $32
         67        DO_ICALL                                         $33     
         68        ASSIGN                                           ~34     !5, $33
         69      > JMPNZ                                                    ~34, ->58
   23    70    >   ECHO                                                     '%0A'
   25    71        ASSIGN                                                   !6, ''
   26    72      > JMP                                                      ->78
   27    73    >   INIT_FCALL                                               'fgets'
         74        SEND_VAR                                                 !0
         75        SEND_VAL                                                 4096
         76        DO_ICALL                                         $36     
         77        ASSIGN_OP                                     8          !6, $36
   26    78    >   INIT_FCALL                                               'feof'
         79        SEND_VAR                                                 !0
         80        DO_ICALL                                         $38     
         81        BOOL_NOT                                         ~39     $38
         82      > JMPNZ                                                    ~39, ->73
   29    83    >   INIT_FCALL                                               'fclose'
         84        SEND_VAR                                                 !0
         85        DO_ICALL                                                 
   30    86      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.75 ms | 1404 KiB | 27 Q