note 33187 added to ref.funchand

From: Date: Wed, 18 Jun 2003 13:22:31 +0000
Subject: note 33187 added to ref.funchand
Groups: php.notes 
Request: Send a blank email to php-notes+get-50582@lists.php.net to get a copy of this message
Xavier's example is rather complicated, and his task would be much more simply accomplished by using classes. Define a base class to do the basic functions open, dump, and close, and create extension classes to override whatever behavior. class foo { function open() { // Default functionality for open() } function dump() { // Default functionality for dump() } function close() { // Default functionality for close() } } class bar extends foo { function open() { // Override functionality of open() } // dump() and close() remain as in class foo } ---- Manual Page -- http://www.php.net/manual/en/ref.funchand.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33187 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33187&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33187&report=yes

« previous php.notes (#50582) next »