php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29347 parse error in cgi mode but not in isapi
Submitted: 2004-07-23 06:45 UTC Modified: 2004-07-29 15:49 UTC
From: jpearson at syntreo dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.9 OS: Linux and Windows XP
Private report: No CVE-ID: None
 [2004-07-23 06:45 UTC] jpearson at syntreo dot com
Description:
------------
When in cgi mode attached php script is classed as a parse error, I get:

[roadkill@synsrv1 roadkill]$ php -l blah.php
PHP Parse error:  parse error, unexpected '=', expecting ')' in /home/roadkill/blah.php on line 2
Errors parsing blah.php

When you run the script in isapi mode it works fine.

I tested this bug on php 4.3.4 and 4.3.9-dev on windows xp
and php 4.3.6 and 4.3.8 on Linux (Fedora Core 2)

This is NOT an issue in php 5 (on Windows at least)

This is an issue for me because I have a php syntax check in the commitinfo file for cvs and it won't commit because it claims a parse error.

Reproduce code:
---------------
<?php
function test(&$bar = null){
        echo "No parse error!";
}
$var = "hello";
test($var);
?>


Expected result:
----------------
No parse error!

Actual result:
--------------
PHP Parse error:  parse error, unexpected '=', expecting ')' in /home/roadkill/blah.php on line 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-29 15:35 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Possibility to use default values with arguments passed by reference is PHP5-only.
Check it twice, 4.3.x MUST give you an error message with ISAPI too.
 [2004-07-29 15:49 UTC] jpearson at syntreo dot com
My bad, I just realised display errors was off.  Turned on display errors and sure enough there was a parse error.

Sorry
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Dec 14 02:00:01 2025 UTC