Re: Bug #2675: Misbehavior of object initializers
| From: | ZeroDiVide | Date: | Sat, 06 Nov 1999 04:34:20 +0000 |
| Subject: | Re: Bug #2675: Misbehavior of object initializers | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-12161@lists.php.net to get a copy of this message | ||
On Fri, 5 Nov 1999, Rasmus Lerdorf wrote:
> > $this->type was supposed to be $foo->type
> >
> > >
> > > // This will not
> > > $bar = new Bar();
> > > echo( 'I should be foo also : ' . $bar->type );
> > $this->type was supposed to be $bar->type
>
> Why do you say that $bar->type should be printing "foo"? I obviously
> should print "bar", and it does so on my system.
>
This should be bar's initializer:
Function Bar() {
$this->type = 'bar';
return new Foo();
}
Sorry, i mucked up the code even worse than i thought, i modified
the bug report to reflect it.
It Should of returned a object of $foo... right? or the object
initalizer Bar cannot return nothing except Bar? It would be
nice to polymorph based upon inputs to the function.
Thanks,
J