What is faster: writing PHP code using functions or writing it as pure script? So, as I see it Apache or any other server will create from PHP code using functions a pure script… I mean we had:
function foo($a, $b){ return ($a + $b); }
echo foo(4, 5);
and PHP will turn it into something like:
echo 9;
Or will it?
There should be no noticeable difference in speed whether you break your code into functions or not – but it will be much easier to maintain and read if you break sections out into logical functions and re-use them when appropriate.