Re: Missing __toString() part
| From: | Jasper Bryant-Greene | Date: | Sat, 03 Jun 2006 22:12:30 +0000 |
| Subject: | Re: Missing __toString() part | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23894@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Gwynne wrote:
> I'm new to this list, so I apologize if I'm out of line in commenting
> here, but it's my opinion that the advantages offered by a __hash()
> magic function would outweigh the inevitable complexity and issues
> involved. I imagine that it would be a strict semantic: If the class of
> the object being indexed into the array doesn't define a magic __hash()
> function, it would be a warning or even fatal error; no attempt
> would/should be made to calculate a hash based on anything other than
> what the object is willing to call itself.
I would imagine that __hash() or whatever it is called would be defined
on all objects and implemented internally in PHP, and would simply
generate some internal hash that is unique for all objects.
- --
Jasper Bryant-Greene
General Manager
Album Limited
http://www.album.co.nz/ 0800 4 ALBUM
jasper@album.co.nz 021 708 334
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
iD8DBQFEgglOFfAeHhDzT4gRA2JtAKC3rkHI6QGo5yYQyHBbuZzG068D6wCgqej3
QqtgAcCeC5qo8ja2oCB4aUw=
=2C/T
-----END PGP SIGNATURE-----