Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89024 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7158 invoked from network); 1 Nov 2015 16:04:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2015 16:04:58 -0000 Authentication-Results: pb1.pair.com header.from=geolim4@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=geolim4@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.43 as permitted sender) X-PHP-List-Original-Sender: geolim4@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wm0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:37916] helo=mail-wm0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/37-13635-92836365 for ; Sun, 01 Nov 2015 11:04:58 -0500 Received: by wmeg8 with SMTP id g8so43071141wme.1 for ; Sun, 01 Nov 2015 08:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=OL79q5BYOYgb7PUkioDomQ3weL5DPPJoo4qZblEaRrQ=; b=XfKMA2Ck/qLWWM9oCe39Qkz+0q3SZiy6+BQHnkkjsN7Mbp0liQD6e4wRcMmq7IQ24m qoMntW0ZS89o1/fdRMv/fsZdysRz1z1ldXwQ0hfTGqQQjjWxjNhkAER/xOuHrLyHxb3n RbRquCMIULAqU8/dQWQI4b+X06heVORASMVCR28GbFKWYGO5vcwA+2AEARFEZ+QLMfS/ qQ7z4U37d+BVqDiPIc2ouL/N8EW4CGSJXSByuwBwMeLsW+KmGE5Dr5AnfMB/NA01uTD5 pP3ZU2Fxi/CuPZmQ2qHDJ8rQHiw7r5EtlEt+uKqNIPlhqiBwWELDPkdANPbbr0CI59or sFyQ== X-Received: by 10.28.138.140 with SMTP id m134mr8398304wmd.74.1446393894244; Sun, 01 Nov 2015 08:04:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.5.78 with HTTP; Sun, 1 Nov 2015 08:04:24 -0800 (PST) Date: Sun, 1 Nov 2015 17:04:24 +0100 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=001a1144360245963d05237cd2d5 Subject: Friend class/function From: geolim4@gmail.com (georges) --001a1144360245963d05237cd2d5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E2=80=8BHi php internals, I recently discovered =E2=80=8Bthe "friendship concept" in c++ and i really= love the concept. And i wonder if the php internals would be interested to implements it in the next 7.x major version. =E2=80=8BThe concept is simple: It would allow declared "friend"=E2=80=8Bclass method/function to call a private/protected member of an other class: The syntax could be like this (for a single friendship): private function extractDataFromCache() friend myFriendClass1 { } or like this for many friendships: private function extractDataFromCache() friend {myFriendClass1::method1, myFriendClass2::method1, myFriendClass3::method1} { } In this way extractDataFromCache() could be called directly by method1 in myFriendClass1 and myFriendClass2 etc.... Off course deep calling should not be allowed. (E.g a function inside myFriendClass1 that will call extractDataFromCache() won't inherit the friendship. Regards, Georges --001a1144360245963d05237cd2d5--