PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
It was a struggle to debug this, and all sorts of other things seemed more likely than the final explanation. Such is the way!
I support Remository, a file repository for the Mambo CMS. The download mechanism has been changed by me, and relies on sending headers followed by the file, simple transferred using readfile().
When the PHP routine just dropped off the end, this apparently resulted in IE and Firefox receiving files with a stray CR character on the end. Opera (my preferred browser) did not. The CR did no harm for most purposes, but upset PCLZIP, which is used for component installation in Mambo. There, the CR caused a fatal error (with unhelpful diagnostic).
The solution is to code an exit statement at the end of the PHP. That solves the problem, but I am left asking if anyone knows why it does?
No executable statements at all (although a function definition). But there might well have been an odd line after the ?>. That would have been sent then? As a CR?