note 30120 deleted from language.oop by didou

From: Date: Fri, 03 Oct 2003 16:35:38 +0000
Subject: note 30120 deleted from language.oop by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57756@lists.php.net to get a copy of this message
Note Submitter: mad.murdock@unknown.com ---- re: immo at nospam dot org While this useful example is correct, it contains a few redundant lines that might be a little confusing... class MemberObject extends ParentObject { var $string; function MemberObject() { $this->string = "This is a test string."; $this->ParentObject(); //this line is not needed as the ParentObject funtion is a constructor for ParentObject class, which MemberObject is extending. Thus, it inherits it and since it is a constructor, it is executed automatically.// } } also class ObjTest { var $ObjPointer; function ObjTest() { $tmp = new MemberObject; $this->ObjPointer = $tmp; } } could be… class ObjTest { var $ObjPointer; function ObjTest() { $this->ObjPointer = new MemberObject; } }

« previous php.notes (#57756) next »