Re: question about :: usage
| From: | Eugene Lee | Date: | Fri, 07 Nov 2003 20:00:00 +0000 |
| Subject: | Re: question about :: usage | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168901@lists.php.net to get a copy of this message | ||
On Fri, Nov 07, 2003 at 11:28:18AM -0800, Chris W. Parker wrote:
:
: Anyway... Here is my problem. I have a class called Validate that has a
: method called ValidateInput. There is another method in this class
: called phonenumber. ValidateInput calls phonenumber at some point like
: this $this->phonenumber($input);.
Won't work. $this refers to the instance of an object.
: Does this mean that one method cannot call another method in the same
: class unless that class in instantiated into an object?
I think so, since your class method is using $this.
: Or does it mean I'm just being brain dead and doing something wrong?
I'm still learning PHP's way of OOP. I don't know the correct way to do
this in PHP, or if there is a correct way, or if it's not doable in PHP4
but is doable in PHP5. Thoughts anyone?