RE: [PHP] OO function overloading?

From: Date: Tue, 12 Aug 2003 00:20:10 +0000
Subject: RE: [PHP] OO function overloading?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-159211@lists.php.net to get a copy of this message
Or, if you'd rather not use an experimental extension, there's this hack (learned from http://www.phpbuilder.com/columns/luis20000420.php3): class MyClass{ function MyClass(){ $name = 'MyClass' . func_num_args(); $this->$name(); } function MyClass1($x){ } function MyClass2($x,$y){ } function MyClass3($x,$y,$z){ } //etc. } Andy > -----Original Message----- > From: Greg Beaver [mailto:greg@chiaraquartet.net] > Sent: Wednesday, August 06, 2003 1:09 AM > To: Jean-Christian Imbeault > Cc: php-general@lists.php.net > Subject: Re: [PHP] OO function overloading? > > Indeed it is a hack, but not for PHP 5, the extension has become part of > the core, and does not require that odd little "overload()" call :) > > Greg > > Jean-Christian Imbeault wrote: > > > Greg Beaver wrote: > > > > > >>This statement isn't entirely correct, overloading is possible with the > >>overload extension. > > > > > > True. Nice work. But still a hack in my mind :) (though a *very* clean > > hack). > > > > Jean-Christian Imbeault > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#159211) next »