note 11810 modified in ref.classobj by felipe

From: Date: Tue, 22 Jul 2008 18:57:38 +0000
Subject: note 11810 modified in ref.classobj by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142533@lists.php.net to get a copy of this message
[Editor's note: If you are trying to do overriding, then you can just interrogate (perhaps in the method itself) about what class (get_class()) the object belongs to, or if it is a subclass of a particular root class. You can alway refer to the parent overriden method, see the "Classes and Objects" page of the manual and comments/editor's notes therein.] There is no function to determine if a member belongs to a base class or current class eg: <?php class foo { function foo () { } function a () { } } class bar extends foo { function bar () { } function a () { } } lala = new Bar(); ?> ------------------ how do we find programmatically if member a now belongs to class Bar or Foo. --was-- [Editor's note: If you are trying to do overriding, then you can just interrogate (perhaps in the method itself) about what class (get_class()) the object belongs to, or if it is a subclass of a particular root class. You can alway refer to the parent overriden method, see the "Classes and Objects" page of the manual and comments/editor's notes therein.] There is no function to determine if a member belongs to a base class or current class eg: class foo { function foo () { } function a () { } } class bar extends foo { function bar () { } function a () { } } lala = new Bar(); ------------------ how do we find programmatically if member a now belongs to class Bar or Foo. http://php.net/manual/en/ref.classobj.php

« previous php.notes (#142533) next »