Edit report at https://bugs.php.net/bug.php?id=45612&edit=1
ID: 45612
Comment by: dhaarbrink at gmail dot com
Reported by: ganswijk at xs4all dot nl
Summary: server version of php should ignore first line
starting with #!
Status: Open
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: unix
PHP Version: 5.2.6
Block user comment: N
Private report: N
New Comment:
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'.
Previous Comments:
------------------------------------------------------------------------
[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