Re: ifsetor like expression in php6
| From: | Sam Barrow | Date: | Sat, 26 Jan 2008 22:31:10 +0000 |
| Subject: | Re: ifsetor like expression in php6 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34950@lists.php.net to get a copy of this message | ||
On Sat, 2008-01-26 at 22:13 +0100, Lars Strojny wrote:
> Hi,
>
> Am Samstag, den 26.01.2008, 12:17 -0500 schrieb Sam Barrow:
> > I don't think throwing a E_NOTICE is appropriate. The isset() construct
> > doesn't throw an E_NOTICE, this shouldn't either.
>
> As far as I understand it is just an extension to the already present
> tertiary operator and therefore the ifsetor would be
> isset($_GET['foo']) ?: 'bar'. I don't understand why that sugar should
> act anything different and not trigger an E_NOTICE.
Yes, you're right. I misunderstood this to mean isset($foo) ? $foo :
$default. I didn't realize that Sebastian was referring to the new
shortcut for the ternary operator.