3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = stream_socket_server('unix:///tmp/demo.sock'); $c = stream_socket_client('unix:///tmp/demo.sock'); var_dump( stream_socket_get_name($s, true), stream_socket_get_name($c, false) );
Output for 8.0.13 - 8.0.20, 8.1.0 - 8.1.7
Warning: stream_socket_server(): Unable to connect to unix:///tmp/demo.sock (Unknown error) in /in/VStV6 on line 3 Warning: stream_socket_client(): Unable to connect to unix:///tmp/demo.sock (Connection refused) in /in/VStV6 on line 4 Fatal error: Uncaught TypeError: stream_socket_get_name(): Argument #1 ($socket) must be of type resource, bool given in /in/VStV6:7 Stack trace: #0 /in/VStV6(7): stream_socket_get_name(false, true) #1 {main} thrown in /in/VStV6 on line 7
Process exited with code 255.
Output for 7.0.21 - 7.0.25, 7.1.7 - 7.1.26, 7.1.28 - 7.1.29, 7.1.31 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0, 7.3.3 - 7.3.6, 7.3.8, 7.3.10 - 7.3.31, 7.4.3 - 7.4.25, 8.0.0 - 8.0.12
bool(false) bool(false)
Output for 7.3.1 - 7.3.2, 7.3.7, 7.3.9, 7.3.32 - 7.3.33, 7.4.0, 7.4.26 - 7.4.30
Warning: stream_socket_server(): unable to connect to unix:///tmp/demo.sock (Unknown error) in /in/VStV6 on line 3 Warning: stream_socket_client(): unable to connect to unix:///tmp/demo.sock (Connection refused) in /in/VStV6 on line 4 Warning: stream_socket_get_name() expects parameter 1 to be resource, bool given in /in/VStV6 on line 7 Warning: stream_socket_get_name() expects parameter 1 to be resource, bool given in /in/VStV6 on line 8 bool(false) bool(false)
Output for 7.1.27, 7.1.30
Warning: stream_socket_server(): unable to connect to unix:///tmp/demo.sock (Unknown error) in /in/VStV6 on line 3 Warning: stream_socket_client(): unable to connect to unix:///tmp/demo.sock (Connection refused) in /in/VStV6 on line 4 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/VStV6 on line 7 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/VStV6 on line 8 bool(false) bool(false)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.30, 7.0.0 - 7.0.20, 7.1.0 - 7.1.6
bool(false) string(1) ""
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: stream_socket_server() in /in/VStV6 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: stream_socket_server() in /in/VStV6 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: stream_socket_server() in /in/VStV6 on line 3

preferences:
56.94 ms | 418 KiB | 5 Q