|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28335 wddx_serialize_value returns empty string
Submitted: 2004-05-09 09:16 UTC Modified: 2005-02-03 01:00 UTC
From: antonr at game dot permonline dot ru Assigned:
Status: No Feedback Package: WDDX related
PHP Version: 5CVS-2004-05-09 (dev) OS: Win32
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: antonr at game dot permonline dot ru
New email:
PHP Version: OS:


 [2004-05-09 09:16 UTC] antonr at game dot permonline dot ru
In some cases wddx_serialize_value returns empty string.

Reproduce code:
  class MyClass1
    { public $myclass2;

  class MyClass2
    { public $myclass1;

  $a = new MyClass1;
  $a->number = 1;
  $a->myclass2 = new MyClass2;
  $a->myclass2->myclass1 = $a;

  echo wddx_serialize_value($a);

Actual result:
empty string


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-21 12:46 UTC] clemens at gutweiler dot net
This example segfaults with PHP-5-RC3.
It contains recursive objects and should be solved like the 'r:123'-way in serialize().
 [2004-06-30 12:56 UTC]
A quotation from "The WDDX DTD" bundled in the WDDX SDK 10a.

Serialization model-
WDDX serializes data using a model of pure aggregation. It has no mechanism for handling object references. Aliased references will result in multiple object instances being deserialized. WDDX serialization applied to a data structure that has cyclical references will most likely result in infinite iteration/recursion, depending on the serializer implementation. Object references support is another area of 
future investigation.

Since WDDX instances are not designed to hold references as stated in the documentation, circular references doesn't make sense with it. It works differently from the serialize() function in essence. But, segfault should be prevented in a manner that wouldn't serialize objects referenced that way.

Patch can be found here:
 [2004-06-30 15:45 UTC] antonr at game dot permonline dot ru
Probably you should part the objects themselves and links to these objects. And then serialize them separately.
 [2005-01-26 04:57 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-02-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 14:01:25 2023 UTC