Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49214 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97539 invoked from network); 6 Aug 2010 14:42:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2010 14:42:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:52271] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/52-21239-55F1C5C4 for ; Fri, 06 Aug 2010 10:42:30 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 183A570042CB for ; Fri, 6 Aug 2010 15:42:26 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id m+dWOvWkYhkL for ; Fri, 6 Aug 2010 15:42:25 +0100 (WEST) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id DAD1570042CA for ; Fri, 6 Aug 2010 15:42:25 +0100 (WEST) Received: from damnation.dulce.lo.geleia.net (52.152.108.93.rev.vodafone.pt [93.108.152.52]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id B738B200A8BF for ; Fri, 6 Aug 2010 15:42:25 +0100 (WEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net References: <4C5C1D2E.6070805@easyflirt.com> Date: Fri, 06 Aug 2010 15:42:01 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_IST?= Message-ID: In-Reply-To: <4C5C1D2E.6070805@easyflirt.com> User-Agent: Opera Mail/10.60 (Win32) Subject: Re: [PHP-DEV] Indexing an array From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Fri, 06 Aug 2010 15:33:18 +0100, mathieu.suen wrote: > Hi, > > For now you can only index an array using a scalar type or a string. > Is there some rfc or work going on to enlarge the possibility so that it > is possible to have some other object like: > > - closure > - object > - etc. I think the problem with that is how you are going to generate the hash of arbitrary objects in order to store them in the hash table. It's not like all PHP objects have a hashCode() method. So the only plausible option would be to attribute the same hash to all and the test all for equality on an insertion with a new key or in the worst case scenario for updates and reads. -- Gustavo Lopes