Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49215 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98813 invoked from network); 6 Aug 2010 14:44:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2010 14:44:48 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-gw0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:56699] helo=mail-gw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/92-21239-FDF1C5C4 for ; Fri, 06 Aug 2010 10:44:48 -0400 Received: by gwj15 with SMTP id 15so3274113gwj.29 for ; Fri, 06 Aug 2010 07:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:reply-to :in-reply-to:references:from:date:message-id:subject:to:cc :content-type; bh=SifnwqyUkKL9mDhxjRtI1CsCmj0RbG+o+GD0cKAE6IY=; b=uu71gaXPsdt3nFw+p0bwA3LQ+LB2scdlEcKZWpUdBD/U6pb8+4XxSdgEdm15h3Eruo YL2NQkvA6Z+seQMJRmqpkdbNtQa1f+TUHN5IYCCPIRQ0jtRYVlu0Fs1Ga9ti+gGknmZK AaQn51+OF4ZhXnGhTreG/GEVeVJDOVNQ7Kl3Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; b=Q736G+XBNO9rk9kronhe0WgD7qccc7rQHj5yI8sWo1QPsWEUWu7vWbwUnJ3HG0qNMb mSC/lqZlE0f4RLvGSXOk6fpoNMfEKSKVDehJ8Sfvr70QKo3a8Xp+LWDOKot5QUPXEVuC E2HbLncuGbK7mf0IqhF2con4inSsH/dOHMid4= Received: by 10.150.2.19 with SMTP id 19mr14142260ybb.53.1281105883382; Fri, 06 Aug 2010 07:44:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.180.220 with HTTP; Fri, 6 Aug 2010 07:44:23 -0700 (PDT) Reply-To: RQuadling@googlemail.com In-Reply-To: <4C5C1D2E.6070805@easyflirt.com> References: <4C5C1D2E.6070805@easyflirt.com> Date: Fri, 6 Aug 2010 15:44:23 +0100 Message-ID: To: "mathieu.suen" Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Indexing an array From: rquadling@gmail.com (Richard Quadling) On 6 August 2010 15:33, 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. > > Thanks > > -- Mathieu Suen > > > > If an object implements a __toString() magic method, then it can work ... 'First', "$randomizer" => 'Second', "$randomizer" => 'Third', "$randomizer" => 'Fourth', ); print_r($array); ?> outputs ... Array ( [1365443950] => First [1235256771] => Second [520059180] => Third [486985268] => Fourth )