Re: help with classes
| From: | Joseph H Blythe | Date: | Wed, 14 Feb 2001 04:56:21 +0000 |
| Subject: | Re: help with classes | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39342@lists.php.net to get a copy of this message | ||
On Mon, 12 Feb 2001 23:44:08 -0500 (EST)
Sean wrote:
SC>
SC> That's how you have to do it.
SC>
SC>
SC> class MyClass {
SC> var $bar;
SC>
SC> // This is the class's constructor
SC> sub MyClass () {
SC> $this->bar = $foo;
SC> }
SC> }
I didn't think php had sub routines like perl? shouldn't that be:
function MyClass(){
$this->bar = $foo;
}
I tried this and it does not evaluate the variable. The only way I could get this to work was to
create a function that I can pass the variable to as one of it paramaters (see previous post)
I could be wrong?
Regards
Joseph