3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $socket_context = stream_context_create($options = array()); $socket = stream_socket_client ( 'example.com' . ":" . 80, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $socket_context ); print_r($errstr); ?>
based on dslKl
Output for 7.0.20, 7.1.5 - 7.2.0
Notice: Undefined variable: timeout in /in/PRSZB on line 9 Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: System error in /in/PRSZB on line 11 Warning: stream_socket_client(): unable to connect to example.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/PRSZB on line 11 php_network_getaddresses: getaddrinfo failed: System error
Output for 7.0.0 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Notice: Undefined variable: timeout in /in/PRSZB on line 6 Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/PRSZB on line 10 Warning: stream_socket_client(): unable to connect to example.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/PRSZB on line 10 php_network_getaddresses: getaddrinfo failed: Name or service not known
Output for 7.0.4
Notice: Undefined variable: timeout in /in/PRSZB on line 6 Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: System error in /in/PRSZB on line 10 Warning: stream_socket_client(): unable to connect to example.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/PRSZB on line 10 php_network_getaddresses: getaddrinfo failed: System error
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 5.6.28
Notice: Undefined variable: timeout in /in/PRSZB on line 9 Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/PRSZB on line 12 Warning: stream_socket_client(): unable to connect to example.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /in/PRSZB on line 12 php_network_getaddresses: getaddrinfo failed: Name or service not known
Output for 5.3.18 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19
Notice: Undefined variable: timeout in /in/PRSZB on line 9 Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: System error in /in/PRSZB on line 12 Warning: stream_socket_client(): unable to connect to example.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/PRSZB on line 12 php_network_getaddresses: getaddrinfo failed: System error