On Fri, Aug 3, 2012 at 12:26 AM, Alex Aulbach <alex.aulb...@gmail.com>wrote:

> 2012/8/2 Andrew Faulds <a...@ajf.me>:
> > Hi,
> >
> > Also in JavaScript if in strict mode. Legacy non-strict mode JS doesn't
> cause an error though.
> >
> > JS's || operator supresses this error though, which is great for e.g. x
> = x || new Object();
>
> Could be cool to make this in PHP with the 'or' operator (or not ||)...
> Which brings us back to the subject...
>
> --
> Alex Aulbach
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
most/some of the ideas here were brought up before, there is a proposal and
a nice history of mailing list discussions (albeit not up-to-date) at
https://wiki.php.net/rfc/ifsetor
personally I would really like an ifsetor/coelesce kind of language
construct.
accepts any number of arguments, won't trigger notice on unset variables,
and returns the first non-null argument.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to