Page 1 of 1

Totally Confused About Public/Private variables in class

Posted: Fri Mar 03, 2006 9:39 pm
by jwalsh
Hey Guys,

I'm totally lost why this doesn't work..

Code: Select all

class Test
{
	private $_variable;

}
... but this does ...

Code: Select all

class Test
{
	var $_variable;

}
Public also does not work. This is not just constrained to variables, but also to functions/methods.

The error is as follows...

Code: Select all

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /path/to/myfile.php on line 4
Error referencing the Private Definition.

Thanks guys

Posted: Fri Mar 03, 2006 9:52 pm
by jwalsh
What the... where did PHP5 go, and why is 4 back on my server.... that explains everything!

Josh

Posted: Sat Mar 04, 2006 9:20 am
by Chris Corbyn
jwalsh wrote:What the... where did PHP5 go, and why is 4 back on my server.... that explains everything!

Josh
Hahahaha :lol:

Posted: Sat Mar 04, 2006 11:34 am
by John Cartwright
ahem :roll:

Posted: Sat Mar 04, 2006 8:49 pm
by Ambush Commander
Ask your server's support to turn it back on for your account.

No doubt they switched back to 4 because of complaints from non PHP5 compatable scripts.