Download & Extend

PHP4 compatability: Parse error: syntax error, unexpected '&'

Project:KML
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Received the following error on install:

Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in ../modules/kml/kml.module on line 700

Line 700 of kml.module is:

    foreach ($nodes_array as &$node) {

The correct code should be:

    foreach ($nodes_array as $node) {

I deleted the & and the module successfully installed.

Comments

#1

Thanks for the report. Can I just ask what version of PHP you use? This seems to work fine for me, and I think it's valid (see e.g.).

#2

Looks like it's invalid in PHP4: #260016: PHP 4 Parse error: syntax error, unexpected '&'. We should see if there's another way of doing it, but, ideally, is there any way you can upgrade to PHP5?

#3

Thats a big negatory. I setup the htaccess file with AddType x-mapp-php5 .php and my whole site goes kaput. Probably cause I'm using 1and1's hosting package. Unless of course I mistyped the above line.

#4

Title:Parse error: syntax error» PHP4 compatability: Parse error: syntax error, unexpected '&'

Ok, if the code is working for you without the & (passing updates back to the original variable) then stick with that for now. The idea is that the changes being made in that foreach statement would be stored for later use, but currently I don't think they're used later on.

#5

Status:active» fixed

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.