Re: Friend class/function
| From: | Andrea Faulds | Date: | Sun, 01 Nov 2015 19:35:50 +0000 |
| Subject: | Re: Friend class/function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89027@lists.php.net to get a copy of this message | ||
Hi Georges,
georges wrote:
Hi php internals, I recently discovered the "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.I recently wished PHP had this feature when trying to implement the Khronos Group Typed Arrays specification in PHP, which requires sharing certain data between unrelated (inheritance-wise) classes. I ended up having to expose a public method to get the data, but named in a way that was likely to deter use. I think friend classes might be useful, then. I'm not sure if they're necessarily something we should add to HPP, though. Are there that many use-cases? Thanks. -- Andrea Faulds http://ajf.me/