>Doesn't @ surpress output (in general)?
>Variables don't usually produce an output so putting @ before it shouldn't
>make any difference.

@ suppresses *ERROR* output, not just any old output.

@ echo "foo";

will echo foo out.

@ echo $foo;

will echo out anything in $foo, but if you haven't *PUT* anything in $foo
yet, and if you have E_ALL turned on like you should, then the @ will
suppress the "Warning:" message.

@ can generally appear just about anywhere, and not necessarily just in
front of functions (unless this changed on purpose in 4.2 for some reason
beyond my ken)  I don't use @ a whole lot, except for pg_fetch_row() where
you pretty much have to (ugh!)

Anyway, this is legal (or was before 4.2), if silly:

if (@$foo){
}

Here, the test for $foo, which might not be set, will suppress the
"Warning:" about $foo not being set, because there is an @ in front of it.

Of course, you *OUGHT* to be using:

if (isset($foo)){
}

in the first place!

I dunno why the @ behaviour changed in the original post's case.

Might even be an actual bug...

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to