I’m writing a Content Management System in PHP, and I want it to be the smallest one in the world. I’m planning to make it available to everyone, just like Drupal and Joomla. But to make it so ultra-tiny, I change code to smaller code.
For example, I change:
$info = parse_ini_file("info.scm"); /* to */ $i=parse_ini_file("info.scm");
just to make it smaller. But, I use some functions very often, like preg_replace();. I use it over 30 times. Should I make a function like:
function p($p,$r,$s){preg_replace($p,$r,$s);}
//and than just use:
p($my_regex, $my_replacement, $my_string);
or does this make it all work slower?
Notice that my goal is to make it so tiny as possible.
It makes sense when it is code you need to push to a client (JavaScript from a server for example) but when it runs locally on the server, as is the case for php, there is little (if any) performance gain.