note 93249 deleted from language.operators.comparison by danbrown
| From: | danbrown@php.net | Date: | Sun, 30 Aug 2009 18:48:23 +0000 |
| Subject: | note 93249 deleted from language.operators.comparison by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160050@lists.php.net to get a copy of this message | ||
Note Submitter: atli at advefir dot com
----
@ 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.