Jump to content

Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /a/pag


csplrj

Recommended Posts

Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /a/page1.php on line 121

 

I am getting the above error

 

I have used & operator to pass the value by refrence. This works in PHP 5 but not in 4.4.2. Is that & operator is not availabe in PHP 4.4.2?

 

Thanks in advance

 

CSJakharia

The code is

 

foreach($row as &$value)

 

 

This works on PHP 5 but not on PHP 4.4.2

 

Bye for now

 

CSJakharia

 

It's not available in 4.4.2.

 

As of PHP 5, you can easily modify array's elements by preceding $value with &. This will assign reference instead of copying the value.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.