I've written up an RFC/Patch to gauge interest and get feedback on the
addition of a combined comparison (aka: spaceship) operator.
You can see the RFC at:
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
It works with all types (just as well as <, <=, >=, > work) and is great
for usort() callbacks for example.
Code available here (against 5.6):
I'd love to get this into 5.6, not sure if we hit feature freeze yet.
Also, not sure if it needs 2/3 majority, but assumed so as pow did?
If there is interest, I'll start adding tests. They should be fairly
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php