3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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;
based on cfH7l
Output for 7.3.0rc3
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 hhvm-3.15.4, 7.1.10, 7.2.0, 7.3.0alpha1 - 7.3.0beta1
Output for 7.1.20, 7.2.6
Warning: fopen(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp:/in) 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) 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, boolean given in /in/P46cQ on line 11
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Warning: fopen(): open_basedir restriction in effect. File(/proc/self/mem) is not within the allowed path(s): (/tmp/) 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 /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, boolean given in /in/P46cQ on line 11