3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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); ?>
Output for 5.2.3 - 5.2.5, 5.3.11 - 5.3.13, 5.3.18 - 5.3.19, 5.3.23, 5.3.25, 5.3.27 - 5.4.14, 7.2.6
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (0)
Output for 7.0.20, 7.1.5 - 7.1.10, 7.2.0
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/H16gS on line 6 Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (php_network_getaddresses: getaddrinfo failed: System error) in /in/H16gS on line 6 php_network_getaddresses: getaddrinfo failed: System error (0)
Output for 7.1.20
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32589)
Output for 5.4.15 - 7.0.14, 7.1.0
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/H16gS on line 6 Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/H16gS on line 6 php_network_getaddresses: getaddrinfo failed: Name or service not known (0)
Output for 5.3.10, 5.3.14 - 5.3.17, 5.3.20 - 5.3.22, 5.3.24, 5.3.26
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (-1)
Output for 5.3.9
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32590)
Output for 5.3.8
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32735)
Output for 5.3.7
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32713)
Output for 5.3.6
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32608)
Output for 5.3.5
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32622)
Output for 5.3.4
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32531)
Output for 5.3.3
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32593)
Output for 5.3.2
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32704)
Output for 5.3.1
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32563)
Output for 5.3.0
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32674)
Output for 5.2.9, 5.2.12, 5.2.16 - 5.2.17
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32766)
Output for 5.2.11, 5.2.14 - 5.2.15
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32765)
Output for 5.2.10, 5.2.13
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32764)
Output for 5.2.6 - 5.2.8
Warning: fsockopen(): unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in /in/H16gS on line 6 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32767)
Output for 5.0.4 - 5.1.6, 5.2.1 - 5.2.2
<br /> <b>Warning</b>: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport &quot;ssl&quot; - did you forget to enable it when you configured PHP?) in <b>/in/H16gS</b> on line <b>6</b><br /> Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (0)
Output for 5.2.0
<br /> <b>Warning</b>: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport &quot;ssl&quot; - did you forget to enable it when you configured PHP?) in <b>/in/H16gS</b> on line <b>6</b><br /> Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32767)
Output for 5.0.0 - 5.0.3
<br /> <b>Warning</b>: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://secure.example.com:443 (Unable to find the socket transport &quot;ssl&quot; - did you forget to enable it when you configured PHP?) in <b>/in/H16gS</b> on line <b>6</b><br /> Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (124)
Output for 4.4.3 - 4.4.9
<br /> <b>Warning</b>: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: no SSL support in this build in <b>/in/H16gS</b> on line <b>6</b><br /> <br /> <b>Warning</b>: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to secure.example.com:443 in <b>/in/H16gS</b> on line <b>6</b><br /> Success (0)
Output for 4.3.3 - 4.4.2
<br /> <b>Warning</b>: fsockopen(): no SSL support in this build in <b>/in/H16gS</b> on line <b>6</b><br /> <br /> <b>Warning</b>: fsockopen(): unable to connect to secure.example.com:443 in <b>/in/H16gS</b> on line <b>6</b><br /> Success (0)
Output for 4.3.2
<br /> <b>Warning</b>: fsockopen(): no SSL support in this build in <b>/in/H16gS</b> on line <b>6</b><br /> <br /> <b>Warning</b>: fsockopen(): unable to connect to secure.example.com:443 in <b>/in/H16gS</b> on line <b>6</b><br /> Inappropriate ioctl for device (25)
Output for 4.3.0 - 4.3.1

Process exited with code 139.