Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102120 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63640 invoked from network); 18 May 2018 12:37:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 May 2018 12:37:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wm0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:37047] helo=mail-wm0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/B2-13666-BF8CEFA5 for ; Fri, 18 May 2018 08:37:16 -0400 Received: by mail-wm0-f42.google.com with SMTP id l1-v6so14932955wmb.2 for ; Fri, 18 May 2018 05:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=VNVSSSmc83zDMEYTcr0MBbW8W1bjgV3hgrK4muFlUrs=; b=o/Rl3Km/p2TjWdiop9STqDmfcNePDrk2Y1gZY2AW11pqiEjF6J/e9THIXW5hZscNsO RUOlBRHLN+CVlvlLHgZ8H01rN7672upeuh5D3f12lVjsVdxVLEX5+RjINx2P0PePAJqU hitmxVRTIi7v0nnLqiQgsU++gQic0peWgyEycdCE3YzYZNEX/wJA7ueFLl5J7b+mguGe ROD2qUAWDmILmgq4j1dwJRe4J6VuC2sh0JxLeAzLIoqOpDfHFU7/SKViJbj1VE/d3TYF COH7kRUXcG2PQCkjLsAA1DK/jmQC5UBqzZrmQtrWrO+uStZEEfiUdaXrcq6rH8Pxcg9x y0ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=VNVSSSmc83zDMEYTcr0MBbW8W1bjgV3hgrK4muFlUrs=; b=QMcQB3Vp7nt/WixLoks4AWPF8Bb0HoXXv1m61pZ5XLBUzLk13G/CPmTtt4E8pLrF8X gWWvu4JSwCuy0WIGZ54k0+ENhsJKPzjFj/FAuQ1ZP53FocO8d16LOhZ+ce1QPesDq12R M/JRFGgfVOWDwVpvw4xrgf7Gxv+ump3LdjNfcjzs0Ej0PNujr+VDbRQcJu6cArsEM4rL 0B06mFHrW/NKNPJIwkL9D1ZrjzJp9HuSsqmA1tfisN5VaxAJgSKG3zLuJinStbosJz1T gwaKO2EL6RZ7yOFzK43QBxkVlNror2LgH4DQkAGIXWU1yP7Oh7J3tV6FegJEnM3jo1Ln wPLQ== X-Gm-Message-State: ALKqPwdz6J/hNFpkgmW2R5xAXHpVWXAvxYvytZaf2qdRksvQDWIxlJL2 vh8tavNwi65TOfvBQ0ifXWpcM0so X-Google-Smtp-Source: AB8JxZqVFVfdQHAj4GeCdwo3GYwBK02Qo4agu0QVoHQ1GqpgWVFOw0K8ArZNuGdpVong//TEL0MzFA== X-Received: by 2002:a1c:3bd4:: with SMTP id i203-v6mr4768039wma.41.1526647032018; Fri, 18 May 2018 05:37:12 -0700 (PDT) Received: from [10.7.75.30] (188.29.165.249.threembb.co.uk. [188.29.165.249]) by smtp.gmail.com with ESMTPSA id v18-v6sm10935835wrf.76.2018.05.18.05.37.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 05:37:11 -0700 (PDT) Date: Fri, 18 May 2018 13:37:09 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: <47A0DB53-F5B8-4A3E-8288-28154A342ED9@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals Mailing List Message-ID: <483AE0FD-EF65-45D9-ACC4-AE3692A83EFE@gmail.com> Subject: Re: [PHP-DEV] RFC WeakRefs From: rowan.collins@gmail.com (Rowan Collins) On 18 May 2018 13:15:21 BST, Etienne Kneuss wrote: >On Fri, May 18, 2018 at 1:59 PM Rowan Collins >wrote: > >> On 17 May 2018 10:35:11 BST, Etienne Kneuss wrote: >> >That said, if the plan is to subsume pecl-weakref, I suggest we also >> >reimplement weakmaps, which offer a convenient way of storing >> >meta/cache >> >data and is not implementable in userland without trade-offs=2E >> >> It looks to me like WeakMap would be fairly trivial to implement in >> userland as a combination of WeakRef, ArrayAccess, Iterable, and an >> internal SplObjectStorage for the ability to use objects as keys >(although >> I'm not clear why it uses object keys in the first place)=2E >> > >In weakmaps it is the keys that are weak, hence objects only; the >values >are arbitrary data associated with them=2E >The goal is to provide a way to associate metadata that may also be >collected in case the key gets collected=2E >In some sense it would behave as if this metadata was stored as a >property >of the object, only it is stored externally in a weakmap=2E Ah, that makes more sense; there didn't seem to be any accrual description= in the manual of what they were for; maybe I was looking in the wrong plac= e=2E In that case, I understand your request to include it, and apologise f= or the noise :) Regards, --=20 Rowan Collins [IMSoP]