|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2007-08-05 15:31 UTC] pcdinh at gmail dot com
  [2007-12-06 16:06 UTC] helly@php.net
  [2007-12-17 15:16 UTC] davidc@php.net
  [2011-03-18 15:42 UTC] jachym dot tousek at gmail dot com
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
Description: ------------ If a class extends ArrayObject, serializing does not work correctly. All properties are missing after unserializing, only the array contents are remain. ArrayObjects (un)serializes without problems and does not implement the Serializable interface, so there seems no need to change the implementation of that interface. The documentation mentions that it is not possible to serialize objects of internal class. Since ArrayObject itself serializes fine, I regard ArrayObject as "non-internal". May be this is a documentation bug. But this would IMHO limit the broad use of the ArrayObject class. Reproduce code: --------------- class a extends ArrayObject { public $a = 2; } $a = new a(); $a->a = 1; var_dump($a); var_dump($a->a); $a = unserialize(serialize($a)); var_dump($a); var_dump($a->a); Expected result: ---------------- object(a)#1 (1) { ["a"]=> int(1) } int(1) object(a)#1 (1) { ["a"]=> int(1) } int(1) Actual result: -------------- object(a)#1 (0) { } int(1) object(a)#2 (0) { } int(2)