Hi Rowan,
Rowan Collins wrote:
Andrea Faulds wrote on 01/11/2015 19:35:
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.
Would "package" (namespace-based) visibility have solved the problem in
this case? That's something I've often wanted - "this is public within
this Lib, but should never be used outside it".
Yep, that would have worked, and that sounds like a much cleaner
solution. Package/namespace visibility would solve a bunch of other
use-cases too.
Thanks!
--
Andrea Faulds
http://ajf.me/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php