note 10041 added to Classes and Objects
| From: | jasonw754 at yahoo dot com | Date: | Sat, 09 Dec 2000 08:06:36 +0000 |
| Subject: | note 10041 added to Classes and Objects | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8543@lists.php.net to get a copy of this message | ||
Has anyone else encountered a problem when you call an object's constructor from within the
same constructor? I have an object with one of it's member variables acting as a pointer to
another object of the same type. When I try to initialize it within the constructor, I just get
what I guess is a trashed response from the server (with no clue as to what the error was, causing
hours wasted away in trying to hunt it down.
Here is a code example:
class Object {
.
public Object() {
.
this.object = new Object();
}
This causes everything to blow up.
http://www.php.net/manual/language.oop.php