AW: AW: [PHP-DEV] [RFC] Package private class
| From: | Robert Stoll | Date: | Tue, 23 Dec 2014 19:43:12 +0000 |
| Subject: | AW: AW: [PHP-DEV] [RFC] Package private class | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79890@lists.php.net to get a copy of this message | ||
> -----Ursprüngliche Nachricht-----
> Von: Stanislav Malyshev [mailto:smalyshev@gmail.com]
> Gesendet: Dienstag, 23. Dezember 2014 19:34
> An: Robert Stoll; 'Leigh'; guilhermeblanco@gmail.com
> Cc: 'PHP internals'
> Betreff: Re: AW: [PHP-DEV] [RFC] Package private class
>
> Hi!
>
> >
> > namespace ch.tutteli.foo{ public for ch.tutteli.bar, ch.tsphp* private
> > class Foo{} }
>
> This looks like a recipe for totally unmaintainable situation, where each class has its own
> list of places where it is visible, and
> the lists are different for each class. I can kind of get when the people want a class that is
> not visible to other code. But if it's
> not the situation, just use regular class.
>
> I don't think PHP needs arcane rules of class visibility that will be used by 0.001% of
> users and even those would probably
> use it wrong since there's no way to keep all those individual lists in sync.
>
> --
> Stas Malyshev
> smalyshev@gmail.com
>
One common place where you actually want such a feature is when you write unit-tests for such a
private class which you do not want to place into the same namespace. But I agree, the ch.tphp*
example is probably going too far.
Cheers,
Robert