Closed (fixed)
Project:
Subscriptions
Version:
5.x-2.0-beta11
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2008 at 18:40 UTC
Updated:
7 Mar 2008 at 00:42 UTC
Jump to comment: Most recent file
Comments
Comment #1
gustav commentedIt appears that that version of PHP does not like default values for variables that are passed by reference. The attached simple patch (modifying only two lines) should solve the problem.
Comment #2
salvisI must admit that I had some doubts whether a NULL default value would work for a reference parameter, but it works on my PHP 5.1.6. There's some discussion about this on http://ch2.php.net/manual/en/language.references.pass.php, but it's not quite conclusive...
@gustav: Your "simple patch" is huge and tries to replace the entire file. Do you maybe have a problem with the newlines? We actually have a problem with them in that file, too: some are LF-only and some are CR/LF. This will be fixed in the next beta.
To expose the problem: we have a function that takes a reference parameter, and I'd like to pass a NULL to it to tell it to do something special. My solution:
works with PHP5 but not with PHP4.
gustav's proposed fix is
but passing a constant rather than a variable isn't supposed to work at all!
Right now I'm on the edge between
and
I hate introducing dummy variables...
Comment #3
reikiman commentedI noticed the same issue. The immediate symptom is fixed by removing the default values. However that's obviously not 100% accurate. I also removed all the ^M's (as a hated windozism) so if I tried to supply a patch it would be just as large.
Comment #4
salvisThis should work (the @ version doesn't).
Comment #5
beginner commentedI had the same parse error problem.
The patch in #4 works for me.
+1.
Also +1 on removing the ^M's.
Comment #6
salvisComment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.