Re: Using usort() in a class
| From: | Stefan Livieratos | Date: | Wed, 28 Jun 2000 16:09:31 +0000 |
| Subject: | Re: Using usort() in a class | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-22648@lists.php.net to get a copy of this message | ||
It does work with latest CVS. Which version are you using?
Regards
Stefan
----- Original Message -----
From: Bjoern Hoehrmann <derhoermi@gmx.net>
To: Stefan Livieratos <stefan@livieratos.com>
Cc: <php-dev@lists.php.net>
Sent: Wednesday, June 28, 2000 5:40 PM
Subject: Re: [PHP-DEV] Using usort() in a class
> * Stefan Livieratos <stefan@livieratos.com> wrote:
>
> | ----- Original Message -----
> | From: Kristian Koehntopp <kris@koehntopp.de>
>
> Thanks for forwarding, Kristian.
>
> | > cmp() will not be called ($this->cmp reported as an unset variable)
> | > and if you use '$this->cmp()' in the call, it will be called once
> | > with $a and $b undefined.
> | >
> | > Can usort() be used in classes?
> |
> | Try using
> |
> | usort($arr, array($this,"cmp"));
> |
> | I haven't tested it though :)
>
> Doesn't either work. $this->cmp() isn't called.
>
> regards,
> Björn Höhrmann
> --
> http://www.bjoernsworld.de/
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>