Re: assign to $this

From: Date: Thu, 15 Apr 2004 12:56:43 +0000
Subject: Re: assign to $this
References: 1  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-1117@lists.php.net to get a copy of this message
$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) I'm not sure if removing things like returning PEAR_Error from constructors would be called BC break.. - more of a major bug fix.. i know I have _never_ tested return values from new Class... 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);
} Regards Alan
Thanks for your attention, Lorenzo
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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