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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC