Parse error: syntax error, unexpected T_VARIABLE stops the page loading [on hold]

I have a php page which is working on my localhost when I upload this page to hosting. I saw that after the certain place on the page the informations was ending. I turn on the error handling and I saw that I have this error on the php page

Parse error: syntax error, unexpected T_VARIABLE in xxx on line 1

On my localhost its working just fine but when I upload the page to hosting it stops showing the rest of the page where the error occurs. I have

global $car_name;

variable on line 1.
I don’t understand why its happening. Is there a any way to ignore this error and continue to execute the codes as it on my localhost? I would appreciate any help. Thank you very much.

Updated:
Thank you everyone. I apologize. It was little bit silly. The error was on the page where $car_name was defined. It all working now.


Source: syntax

Leave a Reply