What are the limitations of using echo in a stream with Content-Type: application/pdf in PHP?

When using `echo` to output a PDF file in PHP with the Content-Type header set to `application/pdf`, the PDF file may become corrupted or unreadable due to additional characters being included in the output. To solve this issue, you should use `readfile()` function to output the PDF file contents directly without any additional characters.

<?php
$file = 'example.pdf';

header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="' . $file . '"');
header('Content-Length: ' . filesize($file));

readfile($file);
exit;
?>