On Tue, 5 Feb 2019 at 17:06, Dennis Birkholz <p...@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