Re: [RFC] Implicit isset() in Shorthand Ternary Operator

php.internals

Unnamed Person

11 years ago
Andrea Faulds wrote on 16.09.2014 20:34:
> > On 10 Sep 2014, at 10:31, Pierre Joye <pierre.php@gmail.com> wrote: > >> On Tue, Sep 9, 2014 at 12:58 AM, Adam Harvey <aharvey@php.net> wrote: >>> On 8 September 2014 07:56, Christoph Becker <cmbecker69@gmx.de> wrote: >>> +1 on ?? — there's precedent for it, and it means we don't have to >>> explain why the shorthand form of an operator behaves differently to >>> the long form, which is just going to confuse users. >> >> After a 2nd look I have to agree here too. Changing behavior in >> something so widely used as the current operator will likely create >> more pains. A new operator, clearly documented, sounds much cleaner, >> even more as it does something different anyway. > > By popular demand, I’ve changed the RFC to instead propose a ?? operator, > after Nikita Popov generously donated a working ?? patch. In doing so, the RFC > is renamed “Null Coalesce Operator”. > > Please read it: https://wiki.php.net/rfc/isset_ternary > > Thanks! > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >
looks good! What are the pros and cons of a new operator vs. a new function? For example, MySQL has a coalesce() function: http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_coalesce Regards, Thomas

Andrew Faulds

11 years ago
On 16 Sep 2014, at 20:28, Thomas Bley <mails@thomasbley.de> wrote:
> What are the pros and cons of a new operator vs. a new function? For example, MySQL has a coalesce() function: > http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_coalesce
A function is useless as it wouldn’t stop you getting E_NOTICEs.
-- Andrea Faulds http://ajf.me/

Unnamed Person

11 years ago
Sorry, I mean to implement coalesce() as a token like isset() ? Regards, Thomas Andrea Faulds wrote on 16.09.2014 21:30: