3v4l.org

run code in 500+ PHP versions simultaneously
<?php $server = stream_socket_server('0:8080'); //passthru('ls -la ' . escapeshellarg('/proc/' . getmypid() . '/fd')); $fd = 3; $handle = fopen('php://fd/' . $fd, 'r+'); var_dump( stream_socket_get_name($handle, false), stream_get_meta_data($handle) ); $client = stream_socket_accept($handle, 0);
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: stream_socket_server() in /in/PWjMH on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: stream_socket_server() in /in/PWjMH on line 3
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(php://fd/3): failed to open stream: Error duping file descriptor 3; possibly it doesn't exist: [9]: Bad file descriptor in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, bool given in /in/PWjMH on line 10 Warning: stream_get_meta_data() expects parameter 1 to be resource, bool given in /in/PWjMH on line 11 bool(false) NULL Warning: stream_socket_accept() expects parameter 1 to be resource, bool given in /in/PWjMH on line 14
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Warning: stream_socket_server(): Unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 bool(false) array(9) { ["timed_out"]=> bool(false) ["blocked"]=> bool(true) ["eof"]=> bool(false) ["wrapper_type"]=> string(3) "PHP" ["stream_type"]=> string(5) "STDIO" ["mode"]=> string(2) "r+" ["unread_bytes"]=> int(0) ["seekable"]=> bool(true) ["uri"]=> string(10) "php://fd/3" } Warning: stream_socket_accept(): Accept failed: Unknown error in /in/PWjMH on line 14
Output for 8.0.0 - 8.0.30
Warning: stream_socket_server(): Unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(php://fd/3): Failed to open stream: Error duping file descriptor 3; possibly it doesn't exist: [9]: Bad file descriptor in /in/PWjMH on line 8 Fatal error: Uncaught TypeError: stream_socket_get_name(): Argument #1 ($socket) must be of type resource, bool given in /in/PWjMH:10 Stack trace: #0 /in/PWjMH(10): stream_socket_get_name(false, false) #1 {main} thrown in /in/PWjMH on line 10
Process exited with code 255.
Output for 5.3.6 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.19 - 7.0.33, 7.1.5 - 7.1.33, 7.2.0 - 7.2.34
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(php://fd/3): failed to open stream: Error duping file descriptor 3; possibly it doesn't exist: [9]: Bad file descriptor in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 Warning: stream_get_meta_data() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 11 bool(false) NULL Warning: stream_socket_accept() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 14
Output for 7.0.0 - 7.0.18, 7.1.0 - 7.1.4
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(php://fd/3): failed to open stream: Error duping file descriptor 3; possibly it doesn't exist: [9]: Bad file descriptor in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 Warning: stream_get_meta_data() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 bool(false) NULL Warning: stream_socket_accept() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 14
Output for 5.3.0 - 5.3.5
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(): Invalid php:// URL specified in /in/PWjMH on line 8 Warning: fopen(php://fd/3): failed to open stream: operation failed in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 Warning: stream_get_meta_data() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 11 bool(false) NULL Warning: stream_socket_accept() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 14
Output for 5.2.7 - 5.2.17
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(): Invalid php:// URL specified in /in/PWjMH on line 8 Warning: fopen(php://fd/3): failed to open stream: operation failed in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 Warning: stream_get_meta_data(): supplied argument is not a valid stream resource in /in/PWjMH on line 11 bool(false) bool(false) Warning: stream_socket_accept() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 14
Output for 5.2.1 - 5.2.6
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(): Invalid php:// URL specified in /in/PWjMH on line 8 Warning: fopen(php://fd/3): failed to open stream: Address family not supported by protocol in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 Warning: stream_get_meta_data(): supplied argument is not a valid stream resource in /in/PWjMH on line 11 bool(false) bool(false) Warning: stream_socket_accept() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 14
Output for 5.0.1 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(php://fd/3): failed to open stream: Address family not supported by protocol in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 Warning: stream_get_meta_data(): supplied argument is not a valid stream resource in /in/PWjMH on line 11 bool(false) bool(false) Warning: stream_socket_accept() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 14
Output for 5.0.0
Warning: stream_socket_server(): unable to connect to 0:8080 (Success) in /in/PWjMH on line 3 Warning: fopen(php://fd/3): failed to open stream: Bad file descriptor in /in/PWjMH on line 8 Warning: stream_socket_get_name() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 10 Warning: stream_get_meta_data(): supplied argument is not a valid stream resource in /in/PWjMH on line 11 bool(false) bool(false) Warning: stream_socket_accept() expects parameter 1 to be resource, boolean given in /in/PWjMH on line 14

preferences:
55.29 ms | 1192 KiB | 34 Q