#45760 [Opn->Bgs]: Notice: Undefined index "?:" operator
| From: | felipe@php.net | Date: | Fri, 08 Aug 2008 10:54:20 +0000 |
| Subject: | #45760 [Opn->Bgs]: Notice: Undefined index "?:" operator | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-127783@lists.php.net to get a copy of this message | ||
ID: 45760
Updated by: felipe@php.net
-Summary: Notice: Undefined index@"?:" operator
Reported By: s dot masugata at digicom dot dnp dot co dot jp
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Linux Debian(etch)
PHP Version: 5.3CVS-2008-08-08 (snap)
New Comment:
Hello, That behavior is expected. Coming soon it be documented.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2008-08-08 09:45:03] s dot masugata at digicom dot dnp dot co dot jp
Description:
------------
When "?:" operator is used, Notice should not be generated.
Reproduce code:
---------------
<?php
error_reporting( E_ALL );
$user_id = $_GET['user_id'] ?: "anonymous";
echo $user_id.PHP_EOL;
?>
Expected result:
----------------
anonymous
Actual result:
--------------
Notice: Undefined index: user_id in /path/to/to/notice.php on line 4
anonymous
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45760&edit=1