Possible Duplicate:
Workaround for basic syntax not being parsed
I don't understand how to use variables inside objects in php.
For example in javascript I would do this and it would be fine.
var foo = 10,
bar = {option: foo+5}
;
console.log(bar.option);
in php I do the same but it fails
$variable = 10;
class myObject {
var $username = $variable + 5 ;
var $zzz = $username + 5;
}
Also is it possible to use $this
in object or only in functions ?
And lastly how would I set up variable based on another inside the same object like in second line of myObject ? :)