|
|
|
|
|
by ceejayoz
5558 days ago
|
|
> Instead I used c style programming in php which ends up being faster. Faster in performance, or faster to develop and maintain? Most PHP apps I've come across have little need for CPU optimization. Not using built-in functions in those situations is likely to have no practical benefit except making it harder for other PHP devs to work with the code. |
|
if ( ! defined('SOMEINCLUDE')) require('file.php');
then defining SOMEINCLUDE in file.php.
Only saves 3% if i remember correctly but when you're including a hundred includes it adds up and when your site is spread across 30+ load balanced web servers every bit counts. As far as it being easier to maintain, it's easier to debug this way if something goes wrong.
However for things where you've gotta build some huge function (or any function really that's more than a line or 2) to replace a built in for such a small gain in performance I would agree with you.