Hi,
I am running same code over my sub domain and localhost successfully .
<Sub domain link : http://estate.alakmalak.net/list.php >
And i have upload it on another server it gives me such error.
Parse error: syntax error, unexpected ‘&’, expecting T_VARIABLE or ‘$’.....
<original link : http://www.theeverafterestate.com/secure/list.php >
Can anyone help why this error occur ?
ureshpatel5@gmail.com
Parse error: syntax error, unexpected ‘&’, expecting T_V
Moderator: General Moderators
-
ureshpatel5
- Forum Newbie
- Posts: 1
- Joined: Thu Dec 24, 2009 4:15 am
Parse error: syntax error, unexpected ‘&’, expecting T_V
Last edited by ureshpatel5 on Thu Dec 24, 2009 6:32 am, edited 1 time in total.
Re: Parse error: syntax error, unexpected ‘&’, expecting T_V
You have a "&" sign where it shouldn't be on whatever line the error tells you. Try posting the code here. It'll be easier for us to help you.
Re: Parse error: syntax error, unexpected ‘&’, expecting T_V
The most likely scenario is that PHP 5 code is being run on a PHP 4 server. In PHP 4, accessing array elements by reference in a foreach loop will trigger the error. This is a valid syntax in PHP 5.
See "Example #3 Collection" on this manual page.
Another scenario that triggers this error is
For this, there are two possibilities:
Code: Select all
foreach ($array as &$item);Another scenario that triggers this error is
Code: Select all
$a = $&b;- The ampersand (&) is meant to come before the dollar sign ($) so the variable $b can be accessed by reference.
- The ampersand is a typographical error.
PHP 4.4.8 wrote:Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in ... on line ...
Edit: This post was recovered from search engine cache.PHP 5.2.8 wrote:Parse error: parse error, expecting `T_VARIABLE' or `'$'' in ... on line ...