Edit report at https://bugs.php.net/bug.php?id=45612&edit=1
ID: 45612 Updated by: yohg...@php.net Reported by: ganswijk at xs4all dot nl Summary: server version of php should ignore first line starting with #! -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: unix PHP Version: 5.2.6 Block user comment: N Private report: N New Comment: Server version of PHP is supposed to be a embedded script. (Even if when we don't want it) Therefore, PHP should output anything out side of PHP tags. You may be interested in this RFC. https://wiki.php.net/rfc/nophptags Previous Comments: ------------------------------------------------------------------------ [2012-06-09 10:01:39] dhaarbrink at gmail dot com This issue is still current for 5.4.3. This should definitely be addressed. As to the reporter: you can use php_sapi_name() and check if it returns 'cli'. ------------------------------------------------------------------------ [2008-07-24 00:51:02] ganswijk at xs4all dot nl Description: ------------ Perhaps it's a good idea to let the server version of php ignore the first line of a script when it starts with '#!'. That way you can write a script that can serve as a batch script and as a server version of the script which is completely identical and not have the server version show the first line starting with '#!' in the browser screen. It would also be nice to know which criterium a script should use to determine if it's running as a server script or as a CLI script. Currently I'm considering using $_SERVER or using some test on $argv. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=45612&edit=1