"@" before variable name
Hi,
in some php script I saw the [at] char. What's causing it?
Sorry for my English and if you can, correct me. Please.
Re: "@" before variable name
Message-ID: <equdkl$71d$1 [at] news.task.gda.pl> from Adam B. contained the
following:
>in some php script I saw the [at] char. What's causing it?
In a php script I saw the ' [at] ' character. What does it do?
The ' [at] ' character prevents error messages being shown on the screen.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
Re: "@" before variable name
Adam B. wrote:
> Hi,
> in some php script I saw the [at] char. What's causing it?
>
> Sorry for my English and if you can, correct me. Please.
The ' [at] ' 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
[at] include('something');
--
//Aho
Re: "@" before variable name
> The ' [at] ' is used to suppress error messages from functions.
Thanks, but I asked about " [at] " character before a variable name.
For example:
[at] $var = 'value';
Re: "@" before variable name
> Thanks, but I asked about " [at] " character before a variable name.
> For example:
>
> [at] $var = 'value';
http://www.php.net/manual/en/language.operators.errorcontrol .php