Possible
Duplicate:
href="https://stackoverflow.com/questions/2671928/workaround-for-basic-syntax-not-being-parsed">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 ?
:)
No comments:
Post a Comment