note 47538 modified in keyword.extends by sean

From: Date: Fri, 19 Nov 2004 16:41:24 +0000
Subject: note 47538 modified in keyword.extends by sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-80764@lists.php.net to get a copy of this message
Multiple inheritence is often more trouble than it's worth. For example, you have a class foo that inherits from both class bar and class baz. Classes bar and baz both have a fubar() method. When you create a foo object and call its fubar() method, which fubar() method is called: bar's or baz's? It seems to me that using aggregate to glue one class's methods and data to another object is a bit like Ruby's fixins, but I could be wrong... [[Editor's note: The aggregate_* functions have been dropped, as of PHP 5 -S ]] --was-- Multiple inheritence is often more trouble than it's worth. For example, you have a class foo that inherits from both class bar and class baz. Classes bar and baz both have a fubar() method. When you create a foo object and call its fubar() method, which fubar() method is called: bar's or baz's? It seems to me that using aggregate to glue one class's methods and data to another object is a bit like Ruby's fixins, but I could be wrong... http://php.net/manual/en/keyword.extends.php

« previous php.notes (#80764) next »