On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson zeln...@gmail.com wrote:
It'd be nice if, when doing $objA $objB, that that'd invoke
$objA-__compareTo($objB) or something, much like Java's Comparable
interface.
Do you have examples of what this would be useful for? The two things that
It'd be nice if, when doing $objA $objB, that that'd invoke
$objA-__compareTo($objB) or something, much like Java's Comparable
interface.
There is nothing stopping you from creating this in user-land. Also, I have
spent a lot of time writing libraries in PHP and I now believe that this
It'd be nice if, when doing $objA $objB, that that'd invoke
$objA-__compareTo($objB) or something, much like Java's Comparable
interface.
There is nothing stopping you from creating this in user-land. Also, I
have spent a lot of time writing libraries in PHP and I now believe that
this
On 7 May 2013 09:17, Thomas Anderson zeln...@gmail.com wrote:
It'd be nice if, when doing $objA $objB, that that'd invoke
$objA-__compareTo($objB) or something, much like Java's Comparable
interface.
I wrote https://wiki.php.net/rfc/comparable a couple of years ago —
there's a patch there
On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson zeln...@gmail.com wrote:
It'd be nice if, when doing $objA $objB, that that'd invoke
$objA-__compareTo($objB) or something, much like Java's Comparable
interface.
Do you have examples of what this would be useful for? The two things that
come
Its kinda useless feature for PHP.
Daniel Ribeiro Gomes Pereira
Twitter https://twitter.com/#!/drgomesp |
Facebookhttps://www.facebook.com/profile.php?id=10407054469
| LinkedIn http://www.linkedin.com/pub/daniel-ribeiro-gomes/21/414/39
iPhone: +55 (48) 9111-0931
2013/5/7 Nikita Popov
Classes without the ability to overload the comparison operator could be
considered kinda useless as well.
On Tue, May 7, 2013 at 11:11 AM, Daniel Ribeiro drgom...@gmail.com wrote:
Its kinda useless feature for PHP.
Daniel Ribeiro Gomes Pereira
Twitter https://twitter.com/#!/drgomesp |
I proposed something similar recently in the PHP-FIG group, but decided that
without the language-level ability to overload comparison operators,
standardizing comparables ony using methods was not very useful. If PHP could
provide a magic method for comparison that involved being able to use
On Tue, May 7, 2013 at 1:05 PM, Nikita Popov nikita@gmail.com wrote:
On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson zeln...@gmail.com wrote:
It'd be nice if, when doing $objA $objB, that that'd invoke
$objA-__compareTo($objB) or something, much like Java's Comparable
interface.
Do
Hi!
Classes without the ability to overload the comparison operator could be
considered kinda useless as well.
That's demonstrably false - classes are very useful right now in PHP yet
no overloading of operators exists.
--
Stanislav Malyshev, Software Architect
SugarCRM:
Hi!
I wrote https://wiki.php.net/rfc/comparable a couple of years ago —
there's a patch there that would probably still apply without too much
work to master. About the only difference was that I didn't double
underscore the magic method (in line with both Java and PHP interfaces
like
To me, it sounds that those extremely specific cases ask for a extremely
specific compareTo(stdClass) method.
Daniel Ribeiro Gomes Pereira
Twitter https://twitter.com/#!/drgomesp |
Facebookhttps://www.facebook.com/profile.php?id=10407054469
| LinkedIn
12 matches
Mail list logo