Now that objects are accounted for by references and id, it should be
possible to use them as keys in an associative array. That might be an
interesting feature to have.
I don't want to seem naggish, but what do you think?
Now that objects are accounted for by references and id, it should be
possible to use them as keys in an associative array. That might be an
interesting feature to have.
LingWitt@insightbb.com wrote:
I don't want to seem naggish, but what do you think?
Now that objects are accounted for by references and id, itshould be possible to use them as keys in an associative array. That
might be an interesting feature to have.
Yes, nice and generally it's nice to have a language that it's possible
to use
anything as index but what use do you see for it ?
Hash with objects as indexes ..... will hold additional data for objects?
So why not store the data inside the object itself ?
--
--
NetCat
FREE 10MB Email + Antivirus + POP3 + more...
Get it at http://www.doal.co.il:81/free/?c=antivirus
I noticed that echo $object statements in PHP 5 display object ids that
are kept by the engine, so this data is already in the string form and
it is data that exists. As for as a use for this feature, one can't
easily say there is not a use; there have been times when I wished to
have this feature --though I usually found some other way to do it, but
this idea is intuitive.
Andi Gutmans andi@zend.com
I don't think it's a good idea because it would break lots of other
things such as foreach(). keys have to be integers or strings.
Yes, nice and generally it's nice to have a language that it's
possible to use
anything as index but what use do you see for it ?
Hash with objects as indexes ..... will hold additional data for
objects?
So why not store the data inside the object itself ?
At 09:14 PM 11/4/2003 -0500, LingWitt@insightbb.com wrote:
I don't want to seem naggish, but what do you think?
Now that objects are accounted for by references and id, itshould be possible to use them as keys in an associative array. That
might be an interesting feature to have.
I don't think it's a good idea because it would break lots of other things
such as foreach(). keys have to be integers or strings.
I suggest you create key() methods and call those, i.e., $obj->key()
Sorry,
Andi
If you really wanted to do this you could use a serialize()d version of the
object as the key.
LingWitt@insightbb.com wrote in message
news:457640B1-0E01-11D8-97C5-000393030CE6@insightbb.com...
Now that objects are accounted for by references and id, it should be
possible to use them as keys in an associative array. That might be an
interesting feature to have.