Re: proposed access modifier "silent" ... was: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator
| From: | Lars Schultz | Date: | Tue, 12 Apr 2011 12:21:40 +0000 |
| Subject: | Re: proposed access modifier "silent" ... was: Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51879@lists.php.net to get a copy of this message | ||
Am 12.04.2011 13:33, schrieb Richard Quadling:
Notice: Undefined variable Notice: Undefined indexTo me, these two notices are totally different in severity, but that may be because of how i write my code. I'd like to be able to get rid of the "Undefined index" Notice in a nice, clean, readable way, because that does not bother me (in my style of code). I do wanna be notified if i am using an undefined variable, as that implies something wrong on a more basic level. $x = isset($x)?$x:'default x'; I don't want a construct for this, because I was either lazy or made a mistake when I did not define $x initially. -1 $x = isset($_GET['x'])?$_GET['x']:'default x'; I can see the use for an alternative construct for this though, but it's not really a pressing matter to me. +0.5 But that is just me and my code. Lars