php exit improve processing if there are a lot of function definitions after last executable statement

By Jeffrey Simon

I have routinely written php scripts that look like this:

[start of php script]
... executable code
function one() {}
function two() {}
... many more function definitions
[end of script file]

There can be a truly large amount of code in the function definitions.

I am wondering if it would be better to add an exit statement after the last executable statement and before the function definitions, so as to prevent some kind of reading through the lines.

The reason the question comes up is that I notice that when tracing in a debugger, it seems as though there is some kind of reading or parsing of the function definitions. Of course, this could be an artifact of the debugger, and the php acceleration and interpretation functions do not actually have any overhead at this point.

Any best practices regarding the use of the exit statement?

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273