php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38298 serializing of simplexml objects
Submitted: 2006-08-02 15:19 UTC Modified: 2006-08-02 16:24 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: aeldarin at hotmail dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.1.4 OS: Windows
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: aeldarin at hotmail dot com
New email:
PHP Version: OS:

 

 [2006-08-02 15:19 UTC] aeldarin at hotmail dot com
Description:
------------
http://www.php.net/manual/en/function.serialize.php says that built-in objects can't be serialized.

This also means that SimpleXML objects can NOT be stored in the Memcached server since PHP automatically (un)serializes content stored/retrieved to/from Memcached.

What happens is that hundreds of "Node does not exist"-warnings are reported by the memcached-api (via unserialize) when trying to retrieve the SimplXML object.

Being able to easily and efficiently cache SimpleXML with Memcached would be tremendously helpful.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-02 15:33 UTC] tony2001@php.net
There is no way to store internal data structures as text.
 [2006-08-02 16:22 UTC] aeldarin at hotmail dot com
I guess SimpleXML employs a lot of referencing pointers for performance reasons which makes it not possible to serialize without some intermediary which would do a sort of "memblock" with relative pointers/indexes ? Such a intermediary layer for serializing would mean a lot of work, I guess.
 [2006-08-02 16:24 UTC] aeldarin at hotmail dot com
Or perhaps the performance gain on serializing the SimpleXML object with such translation neccessary would be minimal compared to reparsing an XML representation ? Hmmm ...
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jun 18 13:00:01 2026 UTC