Posted by J.O. Aho on 02/14/07 07:36
Adam B. wrote:
> Hi,
> in some php script I saw the @ char. What's causing it?
>
> Sorry for my English and if you can, correct me. Please.
The '@' is used to suppress error messages from functions.
Say you have a none important include() in your code, the script will work
without the include and the hard drive where you have that include may not
always be online, so instead of seeing all the warning messages printed out
--- example ---
Warning: include(something): failed to open stream: No such file or directory
in /www/yourscript.php on line 5
Warning: include(): Failed opening 'something' for inclusion
(include_path='.:/usr/share/php5:/usr/share/php') in /www/yourscript.php on line 5
--- eof ---
You want this pass silently away, then you use
@include('something');
--
//Aho
[Back to original message]
|