wordpress user wordpress user - 1 month ago 8
PHP Question

Does PHP read functions before they are called?

I declare 100 functions, but I don't actually call any of them. Will having so many functions defined affect loading time?

Does PHP process these functions before they are called?

Answer

Yes, php parses all functions on the run, and checks possible syntax errors , (though it does not execute them all this time) and registers their name as a symbol.
When you call any of the functions, php searches for the function in the registered symbol table for function name and then executes that function.
So, better to use functions of your purpose only as it will increase the size of symbol table.