tags:

views:

80

answers:

3

When including a file in another, I want to end the parsing after a certain if statement. Is it ill advised to use this method for terminating a parsing of a script, and does exit; terminate parsing at all, or just the rest of the current php file?

A: 

Exit terminates php execution.

adam
A: 

die() is equivalent to exit() so it will terminate the script

antpaw
+5  A: 

exit stops the whole script. In included files you can use return to exit from the current file without stopping the whole script.

MitMaro
And return; would still work even if it's not included inside a function?
sombe
+1! @Gal From the docs `return() will also end the execution of an eval() statement or script file`
Doug Neiner