Re: [RFC] Change Directory class to behave like an opaque object
| From: | Gina P. Banyard | Date: | Tue, 17 Sep 2024 16:01:19 +0000 |
| Subject: | Re: [RFC] Change Directory class to behave like an opaque object | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125586@lists.php.net to get a copy of this message | ||
On Monday, 16 September 2024 at 18:31, Derick Rethans <derick@php.net> wrote:
> On Sat, 14 Sep 2024, Gina P. Banyard wrote:
>
> > I came across the Directory class while doing some code exploration of
> > ext/standard. This class is effectively an opaque object for Directory
> > resources, however it doesn't behave like one, as it has existed since
> > PHP 4.
> >
> > As such, I am proposing an RFC to turn this class into an opaque
> > object.
> >
> > RFC: https://wiki.php.net/rfc/directory-opaque-object
>
>
> I see you want to make "new Directory" not work - but wouldn't it make
> more sense if that was the prefered way instead of using dir() ?
I don't have any strong preferences, but this could always be amended as a follow-up.
I don't expect anyone to instantiate Directory with new anyway as it results in a broken
object.
Best regards,
Gina P. Banyard