Re: php5 class initialization

From: Date: Tue, 23 Mar 2004 17:16:08 +0000
Subject: Re: php5 class initialization
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-8684@lists.php.net to get a copy of this message
On Tue, 23 Mar 2004, George Schlossnagle wrote: > On Mar 23, 2004, at 11:53 AM, Andrei Zmievski wrote: > > > On Mon, 22 Mar 2004, Andi Gutmans wrote: > >> What would you expect? That if a new style constructor is defined we > >> always > >> use that and allow old-style as regular method? > > > > Yep. > > > I agree with the part about the new-style constructor always being > preferred to the old-style constructor, but besides being really > confusing, where do you being able to call the old-style as a regular > method coming in handy? I could see people doing: class foo { function foo() { ...constructor stuff... } function __construct() { $this->foo(); } } In order to make the class work on both PHP4 and PHP5 in which case it would be essential for foo() to be callable as a regular method in the class. -Rasmus

« previous php.internals (#8684) next »