PHP 4 Parse error: syntax error
jpereza - April 2, 2008 - 20:59
| Project: | Content Templates (Contemplate) |
| Version: | 5.x-2.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | jrglasgow |
| Status: | closed |
Jump to:
Description
I've just installed the ConTemplate module (v5.x-2.0) in my site and after enabling the module, I just got a blank page. All of my site have got blank pages.
Looking at the apache error log I see this error:
PHP Parse error: syntax error, unexpected '=', expecting ')' in C:\\web\\enelsur.es\\sites\\all\\modules\\contemplate\\contemplate.module on line 743
Looking at that line, it looks like this:
function contemplate_eval($tmplt, $obj, &$xml_elements = null) {And if I remove "= null" then, the error disappears and my site come to life again.
My installation:
- PHP 4.4.7
- Web Server Apache/2.2.6 (Win32)
If more info is needed, just ask for it.

#1
I am developing with PHP 5 so this is probably something with PHP 4
if you change line 743 to read
function contemplate_eval($tmplt, $obj, &$xml_elements = array()) {do you still have this same error
#2
Thanks for your quick answer, jrglasgow.
I cannot check it right now, I will do when I get back to home this afternoon.
But I think it won't work because the error said , so I suppose that in PHP 4 you cannot initialize a parameter that have this syntax .
#3
My supposition was true.
I've read in the PHP Manual this:
So, in PHP 4 it cannot be assigned a default value to a parameter passed by reference, as it is trying to do.
#4
I have committed a fix for this, it is in the next release, 5.x-2.01
#5
Automatically closed -- issue fixed for two weeks with no activity.