Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100746 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98245 invoked from network); 22 Sep 2017 01:58:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Sep 2017 01:58:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.175 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.128.175 mail-wr0-f175.google.com Received: from [209.85.128.175] ([209.85.128.175:50719] helo=mail-wr0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/89-62331-D3E64C95 for ; Thu, 21 Sep 2017 21:58:21 -0400 Received: by mail-wr0-f175.google.com with SMTP id w12so5771840wrc.7 for ; Thu, 21 Sep 2017 18:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vaaR/46dzCX+KEk7cUwVfg0vK/JNNO5fArbrA7Z5goc=; b=TGZF8PCCA9MABk1BYJeDQRfVlyMfH1axbQoRlEBd8OyVbenUnLQ7n6NHWvSTsoubtC AI24EeLW34nm0EWv8IzjrtNqBsEtM1H9u9il2/c16ruQIG85Sc0+93V7wijKJu0EMTrC PbKgj2z8btgHvW5BRnZpxg/uRpteBzj5N2QYcMcXBhg3EF3eVx/J6vTQUrHS4YJ0c7fE aN2GSIJPMN3QQD+sFCCh2if2X9oiaBtH3jy2w0ExU2u/D09pnr8ibaeRK87lLgZnxrJ9 bGTcnu3Y+t1uFSoc/IebyFfKcrLlIYzGIyY90JnbVa+/rlb5gpvczg0euwPBnjjpfhi8 N2ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vaaR/46dzCX+KEk7cUwVfg0vK/JNNO5fArbrA7Z5goc=; b=ZTKnyiQlWhl7iI2rvsvNx464eq5pOaM8YhuEPcQ9dzuIhZhfFTbw6KaCIZyRKNG5gY YjMjdPHdNKBCfTYYC1si+LoIGWB1OMC8nVr3RqRoPFm9UUTW0ghKa4n6fxd3/9d+0q6F Cj85YVPAf+h0nwbJpaEMoEUCLw58aVH69MmUq+KoKsScKrxNXVljSD9lzTIQrwS9aBse YGNFXqMEkngQj05L+c/nwT05MEi38Z/RNzZQthtoCGaM6AtIeNiHkcJgTgoCQ5GGRyHb +BDxNCMBJEG0iu/k1b8LRBDFJ3QOCuJj4GKa3wKWpJ3d70+f94tJoBObf9kOJCg9TJ3c Wy8g== X-Gm-Message-State: AHPjjUiaJeJRPNW37osYOidYN9fU1sdMKIsP6Sa5xfWA7uw1Vt+k8GmX FkX1dwHalNyVcwoIun03G9IEKryFjruug4CbkSM= X-Google-Smtp-Source: AOwi7QAMulqPooOF9HBtGkztRXOdAGbdloRR2wvM/fogPRzNUoURySNx2RvCDwFZqo9u+KEaNS6M5r864QTUd1bgKQ4= X-Received: by 10.223.150.113 with SMTP id c46mr3238010wra.30.1506045498399; Thu, 21 Sep 2017 18:58:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.164.6 with HTTP; Thu, 21 Sep 2017 18:58:16 -0700 (PDT) Received: by 10.223.164.6 with HTTP; Thu, 21 Sep 2017 18:58:16 -0700 (PDT) In-Reply-To: References: Date: Fri, 22 Sep 2017 03:58:16 +0200 Message-ID: To: Dustin Wheeler Cc: PHP Internals List Content-Type: multipart/alternative; boundary="001a113c445cf2a06d0559bd8af9" Subject: Re: [PHP-DEV] [RFC] [Discussion] Class Friendship in PHP From: ocramius@gmail.com (Marco Pivetta) --001a113c445cf2a06d0559bd8af9 Content-Type: text/plain; charset="UTF-8" Hey Dustin, Given the amount of use-cases (very low, so far) this feels much much easier if just implemented in userland via `Closure::call()`, since the scope of the patch complicates the class model of PHP by a whole lot. Another simple solution is to use things such as leedavis81/altr-ego, which already exists in userland. On 22 Sep 2017 02:34, "Dustin Wheeler" wrote: > Hi! > > Almost two years ago, I opened discussion regarding my proposal to support > class friendship through a new keyword, `friend`. For a number of reasons > (mostly work-related; some personal) I didn't have time to move the process > forward. There were several hot-topic discussions going through the mailing > list at the time that I believed deserved more attention. I feel that my > RFC was ill-timed, perhaps. That said, we're almost two years into the > future! > > I would like to re-open discussion of my RFC and get it to vote > appropriately soon. > > In the previous discussion, there was on-going work to introduce > package-private classes by Guilherme. As far as I can tell that work is > stalled, pending fundamental changes to how namespaces are implemented in > PHP (https://github.com/php/php-src/pull/947#issuecomment-224912697). Like > many others, I am very excited for the possibility of package-private > classes or namespace visibility features of any kind. Even so, my personal > vision of that landscape includes class friendship as a unique, explicit > and concise expression of tight-coupling between object-oriented > collaborators. I do not feel these efforts are either-or. I believe they > both contribute to a more expressive means of specifying the relationship > between collaborators with regard to visibility. > > The RFC is at: > > https://wiki.php.net/rfc/friend-classes > > I need to rebase my implementation against `master` and send a PR. I will > have that done before voting begins as it includes several test cases and I > would appreciate additional perspectives to catch edge-cases I may not have > thought of. The implementation was quite straight-forward. > > Thanks! > > -- > Dustin Wheeler | Software Developer > NC State University > mdwheele@ncsu.edu > "If you don't know where you're going, it's easy to iteratively not get > there." > --001a113c445cf2a06d0559bd8af9--