Re: Implicit isset/isempty check on short-ternary operator
| From: | Ben Schmidt | Date: | Sat, 16 Apr 2011 12:39:51 +0000 |
| Subject: | Re: Implicit isset/isempty check on short-ternary operator | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51917@lists.php.net to get a copy of this message | ||
Also note this is possible with the recent proposal Hannes and I were discussing. It simply looks like $var = $arr?['key'] ?: 'empty'; The ?[ avoids notices and the ?: works as it always has. Ben.$var = $arr['key'] ?? : 'empty';