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

From: Date: Tue, 16 Sep 2014 19:28:42 +0000
Subject: Re: [RFC] Implicit isset() in Shorthand Ternary Operator
Groups: php.internals 
Request: Send a blank email to internals+get-77272@lists.php.net to get a copy of this message
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

« previous php.internals (#77272) next »