Wrapping all native functions in PHP
Since functions get deprecated and sometimes you just find a better way to
do something I was wondering if it's a good or a bad idea to wrapp all
native functions in PHP to a class of my own. For example:
class PHPFUNC {
public static function f_strrev($string) {
return strrev($string);
}
}
And using them like:
PHPFUNC::f_strrev($string);
Instead of:
strrev($string);
This way I could easily change all function calls simultaneously and I
could swap between mb_ versions and normal ones easily too.
What do you think? Pros? Cons? Does this create a lot of overhead?
No comments:
Post a Comment