Re: RFC: Deprecate json_encode() on classes marked as non-serializable

From: Date: Thu, 05 Sep 2024 19:14:46 +0000
Subject: Re: RFC: Deprecate json_encode() on classes marked as non-serializable
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-125442@lists.php.net to get a copy of this message
> So if we had a #[NotSerializable] attribute (which I agree might be a good idea) it would be > implemented by setting the ZEND_ACC_NOT_SERIALIZABLE flag on a class definition, and if this RFC > passes, it would automatically apply to json_encode() as well as serialize(). > My mistake, I haven't familiarized myself with some of the more recent engine changes but this all makes sense. My point was more to ask the question "Would it be reasonable to expand the scope of this RFC to introduce a #[NotSerializable] attribute along with the rest of the proposal?" Coogle

« previous php.internals (#125442) next »