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
Next revision
Previous revision
rfc:not_serializable [2023/12/09 12:06] maxsemrfc:not_serializable [2023/12/10 12:31] (current) maxsem
Line 3: Line 3:
   * Date: 2023-11-26   * Date: 2023-11-26
   * Author: Max Semenik, maxsem.wiki@gmail.com   * Author: Max Semenik, maxsem.wiki@gmail.com
-  * Status: Draft+  * Status: Under discussion
   * First Published at: http://wiki.php.net/rfc/not_serializable   * First Published at: http://wiki.php.net/rfc/not_serializable
  
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.1702123593.txt.gz · Last modified: 2023/12/09 12:06 by maxsem