I have a class like
class blah extends blahblah{
private $variable = '5';
function somefunction(){
echo $variable;
}
}
this works in php 5 but not in php 4. I get an error:
Parse error: parse error, unexpected
T_VARIABLE, expecting T_OLD_FUNCTION
or T_FUNCTION or T_VA....
I also tried with publicand static. The same error.
How to add a variable inside this class that I can access from all the functions of the class?
source
share