PDA

View Full Version : does return exit a function immediately?


AN-net
08-09-2006, 03:30 PM
if i return something from a function does it exist it immediately?

MarkPW
08-09-2006, 05:36 PM
Yes it does.

Paul M
08-09-2006, 06:07 PM
Yes.

If called from within a function, the return statement immediately ends execution of the current function, and returns its argument as the value of the function call, return will also end the execution of an eval() statement or script file.