Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28940 invoked from network); 7 Oct 2012 23:12:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2012 23:12:21 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.220.170 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:48460] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/C4-07529-45C02705 for ; Sun, 07 Oct 2012 19:12:20 -0400 Received: by mail-vc0-f170.google.com with SMTP id fo14so4162524vcb.29 for ; Sun, 07 Oct 2012 16:12:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=LUMi7jPm4Cw9Xs4Qzig79dl3mVGYCuWMTHXm4Se9tvs=; b=WI8WUSDlfccj2bb1HCtl5Jx7PonmdM1QuIf5tXEg5N+276XEz2t05eJX/sxRZznrop 1O+ItM6P7nmLcyeYvGLcaBVQYlevtgh5LoXuKfAzmNqTAFG42dHiYA0wwOs2lKeDiSpI 2XLoYn1f8C0AxxsOuBJaQLnI2XB1JOr6P3G7yMcr1slr8U182Ez9WRaA8Z7qS5p/IDl7 jJA74es8jA3BkliCWq9jdy4bG0+E8YoSKdH/nO4eGguMxA9Xay0SG9OXyA7tG80gam4z HmHZZu6E6JK22TQx3zHkL2NesZztdj59K1EHkD+N1eNs/OvXNBXGeWICYyvOA1yUmuqc HlFw== MIME-Version: 1.0 Received: by 10.58.207.39 with SMTP id lt7mr9202155vec.40.1349651537984; Sun, 07 Oct 2012 16:12:17 -0700 (PDT) Received: by 10.58.146.103 with HTTP; Sun, 7 Oct 2012 16:12:17 -0700 (PDT) In-Reply-To: <20121007200604.CGVT23973.aamtaout03-winn.ispmail.ntl.com@p2> References: <20121007200604.CGVT23973.aamtaout03-winn.ispmail.ntl.com@p2> Date: Sun, 7 Oct 2012 19:12:17 -0400 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQl2uXomLDXXnyUCZ6VN3b0hA/NHwZP9RNLQUJR0gDRYOCS6VdzpKGzufKA1VcI/qPvUp6Sl Subject: Re: [PHP-DEV] Re: Arrays which have properties of sets From: rasmus@mindplay.dk (Rasmus Schultz) the manual states, "The implementation in SplObjectStorage returns the same value as spl_object_hash()" - so I don't know how this would really work any better than a custom implementation. perhaps safer would be to simply implement a collection-type that requires the classes of elements in the collection to implement an interface, exposing a unique key... and for objects that don't have a unique key, generate sequential keys from a static counter in each class... not ideal if you want to implement a document store that can store "anything", since now every stored object/class needs to provide a key... On Sun, Oct 7, 2012 at 4:06 PM, Jared Williams wrote: > > See SPL's SplObjectStorage. That allows object instances as keys. > > Jared