Forum Moderators: coopster
It is a PHP 4 class where one of the class variables is $name.
I have a function that has a $_POST variable in that I want to assign to $this->name;
This works as expected -
$this->name = $n; ($n is the $_POST variable)
This doesnt work -
$n = $this->name;
I cant work that out...maybe its just me not looking properly but if there is a good reason why could someone let me know.
Thanks
As the manual says that it doesnt matter what order variables are declared in i.e. ($a = $b) === ($b = $a). Just in this case $n = $this->name doesnt work...
Just wanted to know if this was something that others had experienced or if it is just a bug for me, or if i am missing something in the manual.
Seeing as it worked for you im just guessing that there is something wrong with my set up. As i am getting the correct rosponce for $this->name = $n and not for $n = $this->name.
Was really just trying to find out if i was going mad or found some 'bug' with my set up.
Seeing as it is in PHP 4 and they are stopping it guess that in the long run it doesnt matter :)
$this->n = $n;
and
$n = $this->n;
Are not interchangable, they do different things
<edit>
To use your example:
($a = $b) === ($b = $a) is not correct.
($a = $b)!== ($b = $a) is correct.
If Ive misunderstood I apologise for sucking eggs!
[edited by: darrenG at 2:06 pm (utc) on July 15, 2007]