Re: [RFC] Change Directory class to behave like an opaque object

From: Date: Tue, 24 Sep 2024 17:25:44 +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-125670@lists.php.net to get a copy of this message
On Tuesday, 24 September 2024 at 14:34, Christian Schneider <cschneid@cschneid.com> wrote: > Am 14.09.2024 um 17:33 schrieb Gina P. Banyard internals@gpb.moe: > > > 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 > > > While I understand the other proposed changes (although I'm always a bit wary about the > wish to make more and more things final) I was wondering why you would prevent cloning? > What are the possible downsides in allowing people to get a clone of a Directory object? Mainly because the current behaviour doesn't do a proper clone. It still shares a common directory resource with the original object meaning that there is spooky action at a distance even thought cloning is meant to prevent this. Best regards, Gina P. Banyard

« previous php.internals (#125670) next »