|
Posted by Toby Inkster on 11/27/40 11:31
Jonathan N. Little wrote:
> I'll take a stab, highlight_file without a 2nd parameter prints rather
> than returns a string. The && 0 inverts the boolean output so it exits
> with '0' like errorlevel 0 on success and '1' on error.
You're on the right track. highlight_file() does indeed print out rather
than return a string (though from PHP 4.2, there is an option to return a
string instead). It returns TRUE (assuming success).
So this:
exit(highlight_file(BLAH));
becomes this:
exit(TRUE);
Now, exit() doesn't take a boolean value, but an integer, so it interprets
the TRUE as:
exit(1);
so it exits with an error level of 1. If we add the &&0 we get:
exit(1&&0);
forcing an error level of 0.
Why is the error level important? For non-zero error levels, PHP prints
the error level to the browser, so you end up with a little '1' at the end
of your source code.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|