Re: Bug #2675: Misbehavior of object initializers

From: Date: Sat, 06 Nov 1999 02:37:11 +0000
Subject: Re: Bug #2675: Misbehavior of object initializers
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-12158@lists.php.net to get a copy of this message
I messed up on this.... -------------------------------------------------------------------------------- | Jason "ZeroDiVide" Orcutt "Code is life is Code" | | Prometheus Project - http://prometheus.zerodivide.net | -------------------------------------------------------------------------------- On 6 Nov 1999 zerodiv@zerodivide.net wrote: > From: zerodiv@zerodivide.net > Operating system: all tested > PHP version: 3.0.12 > PHP Bug Type: Other > Bug description: Misbehavior of object initializers > > <?php > class Foo { > var $type; > Function Foo() { > $this->type = 'Foo'; > } > } > > class Bar { > var $type; > Function Bar() { > $this->type = 'Bar'; > } > } > > // This will work > $foo = new Foo(); > echo( 'I am foo : ' . $foo->type ); $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 > > ?> > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#12158) next »