Bug #2675: Misbehavior of object initializers
| From: | zerodiv at zerodivide dot net | Date: | Sat, 06 Nov 1999 01:06:51 +0000 |
| Subject: | Bug #2675: Misbehavior of object initializers | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12156@lists.php.net to get a copy of this message | ||
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 : ' . $this->type );
// This will not
$bar = new Bar();
echo( 'I should be foo also : ' . $this->type );
?>