3v4l.org

run code in 500+ PHP versions simultaneously
<?php $url = "https://www.example.com/postSomeData"; $postData = ["event" => "xyz", "someOtherField" => "abc"]; $contentType = "application/x-www-form-urlencoded"; $params = http_build_query($postData); $parts = parse_url($url); try { // $socket = $this->openSocket($parts['host'], ($parts['port'] ?? $parts['scheme'] === 'https' ? 443 : 80)); } catch (Exception $e) { $socket = null; } //if (!$socket) { // return false; //} $request = "POST {$parts['path']} HTTP/1.1\r\n"; $request .= "Host: {$parts['host']}\r\n"; $request .= "Content-Type: $contentType\r\n\r\n"; $request .= $params; echo($request); //fwrite($socket, $request); //fclose($socket);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SY6cp
function name:  (null)
number of ops:  31
compiled vars:  !0 = $url, !1 = $postData, !2 = $contentType, !3 = $params, !4 = $parts, !5 = $e, !6 = $socket, !7 = $request
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'https%3A%2F%2Fwww.example.com%2FpostSomeData'
    4     1        ASSIGN                                                       !1, <array>
    5     2        ASSIGN                                                       !2, 'application%2Fx-www-form-urlencoded'
    6     3        INIT_FCALL                                                   'http_build_query'
          4        SEND_VAR                                                     !1
          5        DO_ICALL                                             $11     
          6        ASSIGN                                                       !3, $11
    7     7        INIT_FCALL                                                   'parse_url'
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                             $13     
         10        ASSIGN                                                       !4, $13
    9    11      > JMP                                                          ->14
   11    12  E > > CATCH                                           last         'Exception'
   12    13    >   ASSIGN                                                       !6, null
   19    14    >   ROPE_INIT                                         3  ~18     'POST+'
         15        FETCH_DIM_R                                          ~16     !4, 'path'
         16        ROPE_ADD                                          1  ~18     ~18, ~16
         17        ROPE_END                                          2  ~17     ~18, '+HTTP%2F1.1%0D%0A'
         18        ASSIGN                                                       !7, ~17
   20    19        ROPE_INIT                                         3  ~23     'Host%3A+'
         20        FETCH_DIM_R                                          ~21     !4, 'host'
         21        ROPE_ADD                                          1  ~23     ~23, ~21
         22        ROPE_END                                          2  ~22     ~23, '%0D%0A'
         23        ASSIGN_OP                                         8          !7, ~22
   21    24        ROPE_INIT                                         3  ~27     'Content-Type%3A+'
         25        ROPE_ADD                                          1  ~27     ~27, !2
         26        ROPE_END                                          2  ~26     ~27, '%0D%0A%0D%0A'
         27        ASSIGN_OP                                         8          !7, ~26
   22    28        ASSIGN_OP                                         8          !7, !3
   24    29        ECHO                                                         !7
   27    30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.18 ms | 1729 KiB | 15 Q