3v4l.org

run code in 300+ PHP versions simultaneously
<?php chdir('/tmp'); $path = str_repeat('x', 101) . '.socket'; $s = stream_socket_server('unix://' . $path); $c = stream_socket_client('unix://' . $path); var_dump(stream_socket_get_name($c, true));
Output for 8.2.21 - 8.2.29, 8.3.9 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
Notice: stream_socket_server(): socket path exceeded the maximum allowed length of 107 bytes and was truncated in /in/hSRCU on line 6 Notice: stream_socket_client(): socket path exceeded the maximum allowed length of 107 bytes and was truncated in /in/hSRCU on line 7 string(107) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socke"
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 5.3.11 - 5.3.29, 5.4.1 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.30, 7.0.0 - 7.0.24, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12, 8.0.29 - 8.0.30, 8.1.20 - 8.1.33, 8.2.8 - 8.2.20, 8.3.0 - 8.3.8
Notice: stream_socket_server(): socket path exceeded the maximum allowed length of 108 bytes and was truncated in /in/hSRCU on line 6 Notice: stream_socket_client(): socket path exceeded the maximum allowed length of 108 bytes and was truncated in /in/hSRCU on line 7 string(107) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socke"
Output for 8.0.13 - 8.0.28, 8.1.0 - 8.1.19, 8.2.0 - 8.2.7
Notice: stream_socket_server(): socket path exceeded the maximum allowed length of 108 bytes and was truncated in /in/hSRCU on line 6 Warning: stream_socket_server(): Unable to connect to unix://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socket (Unknown error) in /in/hSRCU on line 6 Notice: stream_socket_client(): socket path exceeded the maximum allowed length of 108 bytes and was truncated in /in/hSRCU on line 7 Warning: stream_socket_client(): Unable to connect to unix://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socket (Connection refused) in /in/hSRCU on line 7 Fatal error: Uncaught TypeError: stream_socket_get_name(): Argument #1 ($socket) must be of type resource, bool given in /in/hSRCU:9 Stack trace: #0 /in/hSRCU(9): stream_socket_get_name(false, true) #1 {main} thrown in /in/hSRCU on line 9
Process exited with code 255.
Output for 7.4.26 - 7.4.33
Notice: stream_socket_server(): socket path exceeded the maximum allowed length of 108 bytes and was truncated in /in/hSRCU on line 6 Warning: stream_socket_server(): unable to connect to unix://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socket (Unknown error) in /in/hSRCU on line 6 Notice: stream_socket_client(): socket path exceeded the maximum allowed length of 108 bytes and was truncated in /in/hSRCU on line 7 Warning: stream_socket_client(): unable to connect to unix://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socket (Connection refused) in /in/hSRCU on line 7 Warning: stream_socket_get_name() expects parameter 1 to be resource, bool given in /in/hSRCU on line 9 bool(false)
Output for 7.3.32 - 7.3.33
Warning: stream_socket_server(): unable to connect to unix://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socket (Unknown error) in /in/hSRCU on line 6 Warning: stream_socket_client(): unable to connect to unix://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socket (Connection refused) in /in/hSRCU on line 7 Warning: stream_socket_get_name() expects parameter 1 to be resource, bool given in /in/hSRCU on line 9 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.10, 5.4.0
string(107) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.socke"
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: stream_socket_server() in /in/hSRCU on line 6
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/hSRCU on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: stream_socket_server() in /in/hSRCU on line 6

preferences:
199.58 ms | 420 KiB | 5 Q