3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function eheader($header) { echo $header . PHP_EOL; } $file = 'monkey.gif'; eheader('Content-Description: File Transfer'); eheader('Content-Type: application/octet-stream'); eheader('Content-Disposition: attachment; filename='.basename($file)); eheader('Expires: 0'); eheader('Cache-Control: must-revalidate'); eheader('Pragma: public'); eheader('Content-Length: ' . filesize($file)); ob_clean(); flush(); @readfile($file);
Output for 5.3.4 - 5.6.28, 7.0.0 - 7.1.0
Content-Description: File Transfer Content-Type: application/octet-stream Content-Disposition: attachment; filename=monkey.gif Expires: 0 Cache-Control: must-revalidate Pragma: public Warning: filesize(): stat failed for monkey.gif in /in/9Post on line 12 Content-Length: Notice: ob_clean(): failed to delete buffer. No buffer to delete in /in/9Post on line 13
Output for hhvm-3.10.0 - 3.12.0
Content-Description: File Transfer Content-Type: application/octet-stream Content-Disposition: attachment; filename=monkey.gif Expires: 0 Cache-Control: must-revalidate Pragma: public Warning: filesize(): No such file or directory in /in/9Post on line 12 Content-Length:
Output for 5.0.2 - 5.3.3
Content-Description: File Transfer Content-Type: application/octet-stream Content-Disposition: attachment; filename=monkey.gif Expires: 0 Cache-Control: must-revalidate Pragma: public Warning: filesize(): stat failed for monkey.gif in /in/9Post on line 12 Content-Length: Notice: ob_clean(): failed to delete buffer. No buffer to delete. in /in/9Post on line 13
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Description: File TransferPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Type: application/octet-streamPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Disposition: attachment; filename=monkey.gifPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Expires: 0PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Cache-Control: must-revalidatePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Pragma: publicPHP_EOL Warning: filesize(): stat failed for monkey.gif in /in/9Post on line 12 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Length: PHP_EOL Notice: ob_clean(): failed to delete buffer. No buffer to delete. in /in/9Post on line 13
Output for 4.3.10 - 4.4.9
Content-Description: File Transfer Content-Type: application/octet-stream Content-Disposition: attachment; filename=monkey.gif Expires: 0 Cache-Control: must-revalidate Pragma: public Warning: filesize(): Stat failed for monkey.gif (errno=2 - No such file or directory) in /in/9Post on line 12 Content-Length: Notice: ob_clean(): failed to delete buffer. No buffer to delete. in /in/9Post on line 13
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Description: File TransferPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Type: application/octet-streamPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Disposition: attachment; filename=monkey.gifPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Expires: 0PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Cache-Control: must-revalidatePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Pragma: publicPHP_EOL Warning: filesize(): Stat failed for monkey.gif (errno=2 - No such file or directory) in /in/9Post on line 12 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Length: PHP_EOL Notice: ob_clean(): failed to delete buffer. No buffer to delete. in /in/9Post on line 13
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Description: File TransferPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Type: application/octet-streamPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Disposition: attachment; filename=monkey.gifPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Expires: 0PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Cache-Control: must-revalidatePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Pragma: publicPHP_EOL Warning: filesize() [http://www.php.net/function.filesize]: Stat failed for monkey.gif (errno=2 - No such file or directory) in /in/9Post on line 12 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/9Post on line 2 Content-Length: PHP_EOL Notice: ob_clean() [http://www.php.net/ref.outcontrol]: failed to delete buffer. No buffer to delete. in /in/9Post on line 13