No, it is not necessary. When you return from a function, any code after that is not executed. if it does at all, yours could then stop there and not return to the calling function. This exit should go
According to PHP Manual
If called inside a function, the return statement immediately terminates the execution of the current function and returns its argument as the value of the function call. return will also end the execution of the eval () or script statement.
While exit , according to the PHP Manual
Terminates the execution of the script.
So, if your exit was actually executing, it would stop all execution right there
EDIT
Just give a small example to demonstrate what exit does. Say you have a function and you just want to display its return value. Then try this
<?php function test($i) { if($i==5) { return "Five"; } else { exit; } } echo "Start<br>"; echo "test(5) response:"; echo test(5); echo "<br>test(4) response:"; echo test(4); echo "<br>End<br>"; ?>
source share