3v4l.org

run code in 500+ PHP versions simultaneously
<?php $host = 'self-signed.badssl.com'; $ip = gethostbyname($host); $f = stream_socket_client('tcp://' . $ip . ':443', $errstr, $errno, 10); stream_context_set_option($f, 'ssl', 'CN_match', $host); stream_context_set_option($f, 'ssl', 'verify_peer', true); stream_socket_enable_crypto($f, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.25
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/BRR05 on line 4 Warning: stream_socket_client(): unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/BRR05 on line 4 Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in /in/BRR05 on line 5 Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in /in/BRR05 on line 6 Warning: stream_socket_enable_crypto() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 7
Output for 7.0.0 - 7.0.10, 7.1.0
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/BRR05 on line 4 Warning: stream_socket_client(): unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/BRR05 on line 4 Warning: stream_context_set_option() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 5 Warning: stream_context_set_option() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 6 Warning: stream_socket_enable_crypto() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 7
Output for 7.0.20, 7.1.5 - 7.1.33, 7.2.0 - 7.2.13
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: System error in /in/BRR05 on line 4 Warning: stream_socket_client(): unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: System error) in /in/BRR05 on line 4 Warning: stream_context_set_option() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 5 Warning: stream_context_set_option() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 6 Warning: stream_socket_enable_crypto() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 7
Output for 7.2.29 - 7.2.33
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/BRR05 on line 4 Warning: stream_socket_client(): unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) in /in/BRR05 on line 4 Warning: stream_context_set_option() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 5 Warning: stream_context_set_option() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 6 Warning: stream_socket_enable_crypto() expects parameter 1 to be resource, boolean given in /in/BRR05 on line 7
Output for 7.3.0 - 7.3.1, 7.3.32 - 7.3.33, 7.4.0, 7.4.26 - 7.4.33
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: System error in /in/BRR05 on line 4 Warning: stream_socket_client(): unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: System error) in /in/BRR05 on line 4 Warning: stream_context_set_option() expects parameter 1 to be resource, bool given in /in/BRR05 on line 5 Warning: stream_context_set_option() expects parameter 1 to be resource, bool given in /in/BRR05 on line 6 Warning: stream_socket_enable_crypto() expects parameter 1 to be resource, bool given in /in/BRR05 on line 7
Output for 7.3.16 - 7.3.31, 7.4.3 - 7.4.25
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/BRR05 on line 4 Warning: stream_socket_client(): unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) in /in/BRR05 on line 4 Warning: stream_context_set_option() expects parameter 1 to be resource, bool given in /in/BRR05 on line 5 Warning: stream_context_set_option() expects parameter 1 to be resource, bool given in /in/BRR05 on line 6 Warning: stream_socket_enable_crypto() expects parameter 1 to be resource, bool given in /in/BRR05 on line 7
Output for 8.0.0 - 8.0.12
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/BRR05 on line 4 Warning: stream_socket_client(): Unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) in /in/BRR05 on line 4 Fatal error: Uncaught TypeError: stream_context_set_option(): Argument #1 ($context) must be of type resource, bool given in /in/BRR05:5 Stack trace: #0 /in/BRR05(5): stream_context_set_option(false, 'ssl', 'CN_match', 'self-signed.bad...') #1 {main} thrown in /in/BRR05 on line 5
Process exited with code 255.
Output for 8.0.13 - 8.0.30
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: System error in /in/BRR05 on line 4 Warning: stream_socket_client(): Unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo failed: System error) in /in/BRR05 on line 4 Fatal error: Uncaught TypeError: stream_context_set_option(): Argument #1 ($context) must be of type resource, bool given in /in/BRR05:5 Stack trace: #0 /in/BRR05(5): stream_context_set_option(false, 'ssl', 'CN_match', 'self-signed.bad...') #1 {main} thrown in /in/BRR05 on line 5
Process exited with code 255.
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: System error in /in/BRR05 on line 4 Warning: stream_socket_client(): Unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: System error) in /in/BRR05 on line 4 Fatal error: Uncaught TypeError: stream_context_set_option(): Argument #1 ($context) must be of type resource, bool given in /in/BRR05:5 Stack trace: #0 /in/BRR05(5): stream_context_set_option(false, 'ssl', 'CN_match', 'self-signed.bad...') #1 {main} thrown in /in/BRR05 on line 5
Process exited with code 255.
Output for 8.1.34, 8.2.30 - 8.2.34
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: Name or service not known in /in/BRR05 on line 4 Warning: stream_socket_client(): Unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: Name or service not known) in /in/BRR05 on line 4 Fatal error: Uncaught TypeError: stream_context_set_option(): Argument #1 ($context) must be of type resource, bool given in /in/BRR05:5 Stack trace: #0 /in/BRR05(5): stream_context_set_option(false, 'ssl', 'CN_match', 'self-signed.bad...') #1 {main} thrown in /in/BRR05 on line 5
Process exited with code 255.
Output for 8.3.0 - 8.3.27, 8.4.1 - 8.4.8, 8.4.10 - 8.4.14
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: System error in /in/BRR05 on line 4 Warning: stream_socket_client(): Unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: System error) in /in/BRR05 on line 4 Fatal error: Uncaught TypeError: stream_context_set_option(): Argument #1 ($context) must be of type resource, false given in /in/BRR05:5 Stack trace: #0 /in/BRR05(5): stream_context_set_option(false, 'ssl', 'CN_match', 'self-signed.bad...') #1 {main} thrown in /in/BRR05 on line 5
Process exited with code 255.
Output for 8.3.28 - 8.3.35, 8.4.9, 8.4.15 - 8.4.26, 8.5.0 - 8.5.11
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: Name or service not known in /in/BRR05 on line 4 Warning: stream_socket_client(): Unable to connect to tcp://self-signed.badssl.com:443 (php_network_getaddresses: getaddrinfo for self-signed.badssl.com failed: Name or service not known) in /in/BRR05 on line 4 Fatal error: Uncaught TypeError: stream_context_set_option(): Argument #1 ($context) must be of type resource, false given in /in/BRR05:5 Stack trace: #0 /in/BRR05(5): stream_context_set_option(false, 'ssl', 'CN_match', 'self-signed.bad...') #1 {main} thrown in /in/BRR05 on line 5
Process exited with code 255.

preferences:
65.52 ms | 1242 KiB | 47 Q