#49016 [NEW]: Pleace no generate Notice on ?:
| From: | ivan1986 at list dot ru | Date: | Wed, 22 Jul 2009 13:50:32 +0000 |
| Subject: | #49016 [NEW]: Pleace no generate Notice on ?: | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-140060@lists.php.net to get a copy of this message | ||
From: ivan1986 at list dot ru
Operating system: Linux
PHP version: 5.3.0
PHP Bug Type: Feature/Change Request
Bug description: Pleace no generate Notice on ?:
Description:
------------
When using undefined variable in ?: php generate notice
in php 5.2.x very often use this code
$inp = isset($_POST['inp']) ? $_POST['inp'] : 'def_inp';
in php 5.3 want use a shorter code
$inp = $_POST['inp'] ?: 'def_inp';
Reproduce code:
---------------
<?php
$inp = $_POST['inp'] ?: 'def_inp';
echo $inp;
?>
Expected result:
----------------
def_inp
Actual result:
--------------
Notice: Undefined index: inp in /path/to/to/index.php on line 3
def_inp
--
Edit bug report at http://bugs.php.net/?id=49016&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49016&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49016&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49016&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49016&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49016&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49016&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49016&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49016&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49016&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49016&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49016&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49016&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49016&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49016&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49016&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49016&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49016&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49016&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49016&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49016&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49016&r=mysqlcfg