Edit report at http://bugs.php.net/bug.php?id=49016&edit=1
ID: 49016 Updated by: j...@php.net Reported by: ivan1986 at list dot ru Summary: Remove notice error on ?: (undefined index) -Status: Open +Status: Wont fix Type: Feature/Change Request Package: Scripting Engine problem Operating System: Linux PHP Version: 5.3.0 Block user comment: N Private report: N New Comment: For reasoning on the notice: http://markmail.org/message/ivexk3smqa2kfipq Conclusion: It will stay. Previous Comments: ------------------------------------------------------------------------ [2009-07-22 13:50:32] ivan1986 at list dot ru 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 this bug report at http://bugs.php.net/bug.php?id=49016&edit=1