rfc:not_serializable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
rfc:not_serializable [2023/12/09 12:30] maxsemrfc:not_serializable [2023/12/10 12:31] (current) maxsem
Line 51: Line 51:
 </code> </code>
  
-This change requires no changes to the engine whatsoever, all functionality is already present - it merely gets exposed to userspace.+The non-serializable flag is inherited by descendants: 
 + 
 +<code php> 
 +class MyOtherClass extends MyClass 
 +
 +
 + 
 +serialize(new MyOtherClass()); // Exception: Serialization of 'MyOtherClass' is not allowed 
 +</code> 
 + 
 +The above requires no changes to the engine whatsoever, all functionality is already present - it merely gets exposed to userspace. 
 + 
 +This feature will be exposed to reflection by the following additions to ReflectionClass: 
 + 
 +<code php> 
 +public const int IS_NOT_SERIALIZABLE = ZEND_ACC_NOT_SERIALIZABLE; 
 + 
 +public function isSerializable(): bool {} 
 +</code>
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/not_serializable.1702125046.txt.gz · Last modified: 2023/12/09 12:30 by maxsem