Hey guys,
I can't figure it out, there's no way to got like this?
if(PHPVERSION == '5'){
private $type;
}else{
var $type;
}
Any suggestions?
Hey guys,
I can't figure it out, there's no way to got like this?
if(PHPVERSION == '5'){
private $type;
}else{
var $type;
}
Any suggestions?
You won't be able to declare class properties like that, you'll just get a parse error.
'var' works in PHP 4 and PHP 5, although I seems to remember reading that future versions of 5 (and 6?) will generate a warning when it's used.
private/protected/public of course doesn't work in PHP 4.
The best bet would be to stick with one platform. I assume you are trying to write a bit of code which works on 4 and 5. The only option is to opt for the lowest common denominator - version 4.
Failing that maintain two codebases
I'm too lazy! :-) any hacks would be appreciated! I hope so.