Re: suppressing errors with "@"
| From: | Scott Fletcher | Date: | Fri, 05 Jul 2002 21:31:53 +0000 |
| Subject: | Re: suppressing errors with "@" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105750@lists.php.net to get a copy of this message | ||
No, it's not a PHP bug. The "@" can not be used before a PHP variables, or
PHP pre-defined variables like $GLOBALS, $_SESSION, $_GET, $HTTP_POST_VARS,
etc. The "@" is used only before the PHP function as far as I know of.
FletchSOD
"Uri Even-Chen" <webmaster@speedy.co.il> wrote in message
news:3D260D1F.51C8AEB8@speedy.co.il...
> Hi,
>
> I tried to suppress warnings in isset expressions (Uninitialized string
> offset warnings). The original line was something like this:
>
> if (!(isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))
>
> When I added the "@" sign like this:
>
> if (!(isset(@$GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))
>
> My program stopped working, and I got errors like:
>
> PHP Parse error: parse error, expecting
T_VARIABLE' or
>'$'' ....
>
> Eventually, I put the "@" in this place:
>
> if (!(@isset($GLOBALS['SPEEDY_GLOBAL_VARS']['PAGE_NAME'])))
>
> Which works, but why didn't it work the other way? Is it some kind of
> PHP bug?
>
> I'm using PHP Version 4.1.2
>
> Thanks,
> Uri.
> --------------------------------------------------------