Re: assign to $this

From: Date: Thu, 15 Apr 2004 13:14:48 +0000
Subject: Re: assign to $this
References: 1  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-1118@lists.php.net to get a copy of this message
On Thu, 15 Apr 2004 20:56:43 +0800, Alan Knowles wrote: >> $pager =& Pager::factory($options); > > I'd rather see > $pager = Pager::construct($options); > > as factory normally indicates that it may return a implementation > of Pager, (eg. like an inherited class) er, actually it's very close to that: Pager v.2.x is only a delegate for Pager_Jumping and Pager_Sliding, as you can see from Pager.php source. So I guess a factory() method is more proper than a constructor. > I would suggest: > modifying the constructor - and add the following.. > (for the time being support existing behaviour, but trigger an > E_WARNING) > > if (func_get_args()) { > if (php_version() > 4 ) { > echo "Use ::construct()"; > exit; > } > trigger_error("Constructor is depreciated", > "- use ::construct",E_WARNING); > } Yep, that's something I wanted to do to help with the transition. That's just a warning to inform about the unavoidable BC break, though... :-) Thanks, Lorenzo

« previous php.pear.qa (#1118) next »