3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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(): open_basedir restriction in effect. File(monkey.gif) is not within the allowed path(s): (/tmp:/in:/etc) 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 8.0.0 - 8.0.13
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 7.4.33
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 7.4.26 - 7.4.32
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(): open_basedir restriction in effect. File(monkey.gif) is not within the allowed path(s): (/tmp:/in:/etc) 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.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 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
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:
Output for 5.0.2 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
Content-Description: File Transfer Content-Type: application/octet-stream Content-Disposition: attachment; filename=monkey.gif Expires: 0 Cache-Control: must-revalidate Pragma: public <br /> <b>Warning</b>: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for monkey.gif in <b>/in/9Post</b> on line <b>12</b><br /> Content-Length:
Output for 5.0.0 - 5.0.1
Content-Description: File TransferPHP_EOLContent-Type: application/octet-streamPHP_EOLContent-Disposition: attachment; filename=monkey.gifPHP_EOLExpires: 0PHP_EOLCache-Control: must-revalidatePHP_EOLPragma: publicPHP_EOL<br /> <b>Warning</b>: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for monkey.gif in <b>/in/9Post</b> on line <b>12</b><br /> Content-Length: PHP_EOL
Output for 4.4.3 - 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 <br /> <b>Warning</b>: filesize() [<a href='function.filesize'>function.filesize</a>]: Stat failed for monkey.gif (errno=2 - No such file or directory) in <b>/in/9Post</b> on line <b>12</b><br /> Content-Length:
Output for 4.3.10 - 4.3.11, 4.4.0 - 4.4.2
Content-Description: File Transfer Content-Type: application/octet-stream Content-Disposition: attachment; filename=monkey.gif Expires: 0 Cache-Control: must-revalidate Pragma: public <br /> <b>Warning</b>: filesize(): Stat failed for monkey.gif (errno=2 - No such file or directory) in <b>/in/9Post</b> on line <b>12</b><br /> Content-Length:
Output for 4.3.2 - 4.3.9
Content-Description: File TransferPHP_EOLContent-Type: application/octet-streamPHP_EOLContent-Disposition: attachment; filename=monkey.gifPHP_EOLExpires: 0PHP_EOLCache-Control: must-revalidatePHP_EOLPragma: publicPHP_EOL<br /> <b>Warning</b>: filesize(): Stat failed for monkey.gif (errno=2 - No such file or directory) in <b>/in/9Post</b> on line <b>12</b><br /> Content-Length: PHP_EOL
Output for 4.3.0 - 4.3.1
Content-Description: File TransferPHP_EOLContent-Type: application/octet-streamPHP_EOLContent-Disposition: attachment; filename=monkey.gifPHP_EOLExpires: 0PHP_EOLCache-Control: must-revalidatePHP_EOLPragma: publicPHP_EOL<br /> <b>Warning</b>: filesize() [<a href='http://www.php.net/function.filesize'>function.filesize</a>]: Stat failed for monkey.gif (errno=2 - No such file or directory) in <b>/in/9Post</b> on line <b>12</b><br /> Content-Length: PHP_EOL

preferences:
304.95 ms | 402 KiB | 468 Q