3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = '/proc/self/mem'; $fp = fopen($name, 'rb'); // send the right headers header("Content-Type: image/png"); header("Content-Length: " . filesize($name)); // dump the picture and stop the script fpassthru($fp); exit;
Output for 8.3.0 - 8.3.4, 8.3.6
Warning: fopen(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 4 Warning: fopen(/proc/self/mem): Failed to open stream: Operation not permitted in /in/P46cQ on line 4 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 7 Warning: filesize(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 8 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 8 Fatal error: Uncaught TypeError: fpassthru(): Argument #1 ($stream) must be of type resource, false given in /in/P46cQ:11 Stack trace: #0 /in/P46cQ(11): fpassthru(false) #1 {main} thrown in /in/P46cQ on line 11
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: fopen(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 4 Warning: fopen(/proc/self/mem): Failed to open stream: Operation not permitted in /in/P46cQ on line 4 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 7 Warning: filesize(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 8 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 8 Fatal error: Uncaught TypeError: fpassthru(): Argument #1 ($stream) must be of type resource, false given in /in/P46cQ:11 Stack trace: #0 /in/P46cQ(11): fpassthru(false) #1 {main} thrown in /in/P46cQ on line 11
Process exited with code 255.
Output for 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: fopen(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 4 Warning: fopen(/proc/self/mem): Failed to open stream: Operation not permitted in /in/P46cQ on line 4 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 7 Warning: filesize(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 8 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 8 Fatal error: Uncaught TypeError: fpassthru(): Argument #1 ($stream) must be of type resource, bool given in /in/P46cQ:11 Stack trace: #0 /in/P46cQ(11): fpassthru(false) #1 {main} thrown in /in/P46cQ on line 11
Process exited with code 255.
Output for 8.0.0 - 8.0.13
Notice: fpassthru(): Read of 8192 bytes failed with errno=5 Input/output error in /in/P46cQ on line 11
Output for 7.4.33
Notice: fpassthru(): read of 8192 bytes failed with errno=5 Input/output error in /in/P46cQ on line 11
Output for 7.4.26 - 7.4.32
Warning: fopen(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 4 Warning: fopen(/proc/self/mem): failed to open stream: Operation not permitted in /in/P46cQ on line 4 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 7 Warning: filesize(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in:/etc) in /in/P46cQ on line 8 Warning: Cannot modify header information - headers already sent by (output started at /in/P46cQ:4) in /in/P46cQ on line 8 Warning: fpassthru() expects parameter 1 to be resource, bool given in /in/P46cQ on line 11
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.25

preferences:
226.79 ms | 403 KiB | 300 Q