As a side topic note that using exit with integers acts differently than strings. A long time ago I programmed a submission script that would terminate with various status codes. As a coding shortcut instead of doing this:
echo $code;
exit;
I just did this
exit($code);
Sometimes the codes would output ok, sometimes not... this really confused me before I found out that if the value was a string it would output it, otherwise the program would quit with that status code - useless as far as my script was concerned.