php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62107 SplStack serialization problem
Submitted: 2012-05-22 09:23 UTC Modified: 2012-12-09 03:47 UTC
From: ozland2004 at narod dot ru Assigned: levim (profile)
Status: Closed Package: SPL related
PHP Version: 5.3.13 OS: CentOS 5.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ozland2004 at narod dot ru
New email:
PHP Version: OS:

 

 [2012-05-22 09:23 UTC] ozland2004 at narod dot ru
Description:
------------
SplStack object serialization works wrong

Test script:
---------------
$t = new SplStack();
$t->push(1);
var_dump(unserialize(serialize($t)));

Expected result:
----------------
object(SplStack)#32 (2) { ["flags":"SplDoublyLinkedList":private]=> int(6) ["dllist":"SplDoublyLinkedList":private]=> array(1) { [0]=> int(1) } } 

Actual result:
--------------
object(SplStack)#31 (2) { ["flags":"SplDoublyLinkedList":private]=> int(6) ["dllist":"SplDoublyLinkedList":private]=> array(0) { } } 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-23 05:31 UTC] reeze dot xia at gmail dot com
SplStack makes use of SplDoubleLinkedList. It isn't serializable in PHP5.3

serialize method was introduced in PHP5.4 and 5.4 only:

http://svn.php.net/viewvc?view=revision&revision=313183
http://cn2.php.net/manual/en/spldoublylinkedlist.serialize.php
 [2012-12-09 03:47 UTC] levim@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: levim
 [2012-12-09 03:47 UTC] levim@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 00:01:34 2025 UTC