php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53034 shebang parsing problem
Submitted: 2010-10-10 06:48 UTC Modified: 2010-11-21 17:58 UTC
From: cpriest at warpmail dot net Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 5.2, 5.3, trunk OS: CentOS 5.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cpriest at warpmail dot net
New email:
PHP Version: OS:

 

 [2010-10-10 06:48 UTC] cpriest at warpmail dot net
Description:
------------
Using parameters in shebang line causes script errors, doesn't parse & process shebang parameters.

Test script:
---------------
#!/usr/bin/php -d display_errors=1 -d display_startup_errors=1
<?
   echo "1\r\n";
   new a();
   echo "2\r\n";
?>

Expected result:
----------------
1

Fatal error: Class 'a' not found in /opt/tools/bin/mysql_dump_parser.php on line 4

Actual result:
--------------
PHP:  syntax error, unexpected TC_STRING in Unknown on line 7
1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-16 18:23 UTC] felipe@php.net
-Status: Open +Status: Verified -Package: Unknown/Other Function +Package: Scripting Engine problem
 [2010-10-16 18:23 UTC] felipe@php.net
This is because internally the argv[1] is '-d display_errors=1 -d display_startup_errors=1' when passing in the shebang line. And we don't parse such string.
 [2010-10-16 18:26 UTC] felipe@php.net
-PHP Version: 5.3.3 +PHP Version: 5.2, 5.3, trunk
 [2010-10-16 18:26 UTC] felipe@php.net
On 5.2 we got an error message "Invalid configuration directive" in the ini parser instead.
 [2010-11-21 17:58 UTC] felipe@php.net
-Status: Verified +Status: Wont fix
 [2010-11-21 17:58 UTC] felipe@php.net
This is an OS dependent issue, see http://www.in-ulm.de/~mascheck/various/shebang/#splitting
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 04 05:01:28 2025 UTC