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);

preferences:
41.97 ms | 402 KiB | 5 Q