Parse Error Syntax Error Unexpected T_var Expecting T_variable
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
Unexpected Var Php
this site About Us Learn more about Stack Overflow the company Business parse error: syntax error, unexpected t_variable Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask
Php Unexpected T_variable
Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up php syntax error unexpected PHP classes, parse syntax errors when using 'var' to declare variables up vote 3 down vote favorite 1 I am a C# guy trying to translate some of my OOP understanding over to php. I'm trying to make my first class object, and are hitting a few hitches. Here is the beginning of the class: GetID()); while($projectArray[$i] != null) { $projectArray[$i] = new Project($projectArray[$i]); } UserDB.php is where I have all my static functions interacting with the Database for this User Class. I am getting errors using when I use var, and I'm getting confused. I know I don't HAVE to use var, or declare the variables at all, but I feel it is a better practice to do so. the error is "unexpected T_VAR, expecting T_VARIABLE" When I simply remove var from the declarations it works. Why is this? php mysql syntax object share|improve this question asked May 29 '10 at 13:06 user48202 441522 add a comment| 1 Answer 1 active oldest votes up vote 11 down vote accepted You are mixing things up. Before PHP 5 it was var $uid; Since PHP 5 it is private $uid; // or protected $uid; //
Search Username Password Remember Me? Register Lost Password?
Php Variable
facebook google twitter rss Free Web Developer Tools Advanced php foreach Search Forum Programming Languages PHP Development Parse error: syntax error, unexpected
Php Array
T_VAR, expecting T_VARIABLE in C:\wamp\www\www\ Thread: Parse error: syntax error, unexpected T_VAR, expecting T_VARIABLE in C:\wamp\www\www\ Share This Thread Tweet http://stackoverflow.com/questions/2935164/php-classes-parse-syntax-errors-when-using-var-to-declare-variables This + 1 this Post To Linkedin Subscribe to this Thread Subscribe to This Thread March 31st, 2012,06:34 AM #1 No Profile Picture Sparkon View Profile View Forum Posts Registered User Devshed Newbie (0 - 499 posts) http://forums.devshed.com/php-development-5/parse-error-syntax-error-unexpected-t_var-expecting-t_variable-wamp-www-www-895296.html Join Date Mar 2012 Posts 15 Rep Power 0 Parse error: syntax error, unexpected T_VAR, expecting T_VARIABLE in C:\wamp\www\www\ Hi! i know there are plenty of peoples that encouter this error, and i googled a lot before coming here, but i still can't find the way . It's simple, i'm creating a register page where is included another file that is the register_class with all the function etc.. the error -> Parse error: syntax error, unexpected T_VAR, expecting T_VARIABLE in C:\wamp\www\www\classes\register_class.php on line 4 register.php PHP Code: session_start();
if(isset($_SESSION['uid'])){
echo"Youarealreadyloggedin";
echo"
"