note 93249 added to language.operators.comparison
| From: | atli at advefir dot com | Date: | Sun, 30 Aug 2009 18:20:51 +0000 |
| Subject: | note 93249 added to language.operators.comparison | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160049@lists.php.net to get a copy of this message | ||
@ Anonymous (04-Aug-2009 05:44)
The @ operator does seem to suppress the notice when testing for unset array elements using the new
ternary shortcut. (PHP 5.3.0)
<?php
ini_set("display_errors", true);
error_reporting(E_ERROR | E_NOTICE);
$_POST['Unexisting'] = @$_POST['Unexisting'] ?: false;
var_dump($_POST);
?>
No notice is given and the element is set to false, as expected.
----
Server IP: 213.181.100.226
Probable Submitter: 85.220.88.176
----
Manual Page -- http://www.php.net/manual/en/language.operators.comparison.php
Edit -- https://master.php.net/note/edit/93249
Del: integrated -- https://master.php.net/note/delete/93249/integrated
Del: useless -- https://master.php.net/note/delete/93249/useless
Del: bad code -- https://master.php.net/note/delete/93249/bad+code
Del: spam -- https://master.php.net/note/delete/93249/spam
Del: non-english -- https://master.php.net/note/delete/93249/non-english
Del: in docs -- https://master.php.net/note/delete/93249/in+docs
Del: other reasons-- https://master.php.net/note/delete/93249
Reject -- https://master.php.net/note/reject/93249
Search -- https://master.php.net/manage/user-notes.php