note 78569 deleted from language.operators.errorcontrol by tularis
| From: | tularis@php.net | Date: | Tue, 12 Aug 2008 16:36:51 +0000 |
| Subject: | note 78569 deleted from language.operators.errorcontrol by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-143405@lists.php.net to get a copy of this message | ||
Note Submitter: root at mantoru dot de
----
The @ operator can also be prepended to literals (like strings), as they're also statements --
it will suppress any notice about uninitialized variables. If you want to silence a more complex
expression (@ is unary), use braces.
<?php
// variable interpolation
$str = @"Then I said: '$maybeunset'.";
// integer stuffs
$result = @2 * 3 / 0; // = @(2) * 3 / 0 - WRONG (warning)
$result = @(2 * 3 / 0); // RIGHT (no warning), $result is false
?>
@John Chilton's post: As omelnyk said, isset is a language construct and NOT a function, and an
@ token is not allowed there. @isset makes no sense, because under ANY circumstances isset stays
quiet.
Also, "using it with variables all the time" is a VERY bad idea, because it will make your
code EXTREMELY slow. Crank your error_reporting down then.