Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49217 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10967 invoked from network); 6 Aug 2010 15:20:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2010 15:20:50 -0000 Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.177 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 209.85.216.177 mail-qy0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:62196] helo=mail-qy0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/15-21239-1582C5C4 for ; Fri, 06 Aug 2010 11:20:50 -0400 Received: by qyk1 with SMTP id 1so4451445qyk.8 for ; Fri, 06 Aug 2010 08:20:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=wSySfAcl8Cq9jPZYj8TZuNVj22uH0xCV8GhZKuWYVSM=; b=Zmm2DpC/nR2QgKzCpAG43LhbXSxU0m+6ybzpkuE70prZXdknsfm8JOtrTR2rWzQ36p igeoVDUkbvEwswp6f+JKTmtmoyYxo3VXR8tqb/r4ebmxDwH38WxPV/TP2q/Iai4D54jo aMJzET2IfSg/SwkyQX80/egpoP1Kri6xOH23E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=CPA7dl9YRe25wDz+q1batnpMR/OK7lDHeJVgvL7eHD4vVIUW9GZ8WDO+CnyGI3pYCT eAa4MDWALKPwOp152NWyFXsIUuKRunCNWLQ5WP0Lt2AoW9ZJxBsMpqas0yzkbS4O/Xlv uQwBKjZiUx2CiUJrfMoRLuO5zlB3lkGhYvBJE= MIME-Version: 1.0 Received: by 10.224.3.21 with SMTP id 21mr6180942qal.337.1281108047230; Fri, 06 Aug 2010 08:20:47 -0700 (PDT) Received: by 10.229.182.146 with HTTP; Fri, 6 Aug 2010 08:20:47 -0700 (PDT) In-Reply-To: <4C5C1D2E.6070805@easyflirt.com> References: <4C5C1D2E.6070805@easyflirt.com> Date: Fri, 6 Aug 2010 17:20:47 +0200 Message-ID: To: "mathieu.suen" Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Indexing an array From: hannes.magnusson@gmail.com (Hannes Magnusson) On Fri, Aug 6, 2010 at 16: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: > I don't think it makes sense. You can however kindof fake it: $ php -r '$objs = new SplObjectStorage; $std = new stdclass; $std->foo = 1; $objs->attach($std, array(1,2,3,4)); var_dump($objs[$std]);' array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) } -Hannes