fdrouillard
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Downloads
Gallery
Store
Posts posted by fdrouillard
-
-
New to PHP and very new to OOP, and feel the need to ask a basic question.
What exactly is going on in the following statement:
$this->name = $new_name;
I know what the right side of the equation is, but not the left side. Why can't we simply use the variable (or property) $new_name?
Like I said, I'm new to PHP and very new to OOP.
Thanks in advance to anyone with the patience to answer what is likely a ridiculously simply question.
meaning of $this->name = $new_name; ?
in PHP
Posted
If I understand it correctly, $this->name is the value of the name property of the object $this, and the variable $new_name. So information is flowing from left to right, or from the object to the new variable.
I think I'm getting it.
Thank you for the reply. I've started your tutorial and find it very helpful.