Re: PHP_Compat, signature changes

From: Date: Mon, 30 May 2005 05:44:07 +0000
Subject: Re: PHP_Compat, signature changes
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37880@lists.php.net to get a copy of this message
Lukas Smith wrote:
Aidan Lister wrote:
a) Functions with changed signatures live in a class. PHP_Compat_Component::microtime(...); b) Functions have php_compat affixed to them. php_compat_microtime(); c) Functions have another appropriate abbreviation, eg. phpc_microtime(); d) Functions have an underscore, or something affixed, _microtime();
e) wait for Sara Golems extension which will allow you to rewrite any defined function.
IMO, I don't see that as an improvement. Sure it may be convenient, but it looks like it would be a major headache to debug applications that would be using such a feature. Also, unless the extension is included in all PHP versions, this would create major compatibility issues. When it comes to overloading, I think it'd be better stick to OO programming.
aside from that I would recommend using a prefix that can easily be added and removed using a search/replace on your code.
Any prefered one? All of Aidan's suggestions are prefixes to function names... -Philippe

« previous php.pear.dev (#37880) next »