Re: RFC Weakrefs
| From: | Girgias | Date: | Tue, 05 Feb 2019 16:23:27 +0000 |
| Subject: | Re: RFC Weakrefs | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104194@lists.php.net to get a copy of this message | ||
On Tue, 5 Feb 2019 at 17:06, Dennis Birkholz <php@dennis.birkholz.biz>
wrote:
> So I would really prefer the WeakReference class would just be
> serializable with all the consequences you outlined. Maybe for PHP 8 we
> will decide to require all classes to be serializable except classes
> that implement the Unserializable interface or something... Or the magic
> __isSerializable() method that can decide this at runtime for the actual
> state of an object without failing hard when trying it.
>
> Greets
> Dennis
>
That on its own would need an RFC AFAIK and I'm not really a fan of this
hypothetical change.
Also it feels kind of backwards imho. Why should I specify that something
is NOT serializable
when serialisation is a behaviour that usually needs special care with?
Also what would happen when someone does the typical thing to prevent
serialization:
public function __sleep() { throw new Exception(); }
Best regards
George P. Banyard