Re: E_NOTICE when depreciated methods are called

From: Date: Mon, 05 May 2003 07:58:29 +0000
Subject: Re: E_NOTICE when depreciated methods are called
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5225@lists.php.net to get a copy of this message
culley harrelson wrote:
I just realized that HTML_Quickform::addElementGroup() is depreciated in favor of addGroup(). What about raising an E_NOTICE when a depreciated method is called?
what about: PEAR::enableDeprecated() (for PEAR user) PEAR::deprecated('myFunction'); (for package programmer) class PEAR { ... function deprecated($method) { if(true==$GLOBALS['_PEAR_REPORT_DEPRECATED']) { PEAR::raiseError('function $method is deprecated', PEAR_ERROR_DEPRECTED, PEAR_ERROR_TRIGGER, E_USER_NOTICE); } } function enableDeprecated($state) { $GLOBALS['_PEAR_REPORT_DEPRECATED']=$state; }

« previous php.pear.general (#5225) next »