Re: [RFC] Combined Comparison Operator

From: Date: Thu, 13 Feb 2014 04:01:37 +0000
Subject: Re: [RFC] Combined Comparison Operator
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


On 13/02/14 03:58, Davey Shafik wrote:
This adds a new operator "(expr) <=> (expr)" that returns 0 if both operands are equal, 1 if the left is greater, and -1 if the right is greater. It works with all types (just as well as <, <=, >=, > work) and is great for usort() callbacks for example.
It's useful and cool, and adds an awesome new operator name ((T_SPACESHIP <=> T_PAAMAYIM_NEKUDOTAYIM) === 1), but would it be used often enough to justify addition? -- Andrea Faulds http://ajf.me/

Thread (20 messages)

« previous php.internals (#72540) next »