|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57377 Serialise then unserialise fails
Submitted: 2006-11-15 10:47 UTC Modified: 2006-11-17 12:08 UTC
From: Assigned: cem (profile)
Status: Closed Package: SCA_SDO (PECL)
PHP Version: 5.1.6 OS: WinXP
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:
New email:
PHP Version: OS:


 [2006-11-15 10:47 UTC]
I have an xsd that defines an element that can be empty. I can create an object to match OK but if I serialize it it will not de-serialize.

I knwo the example looks a little odd but this is a simplified version of what we do when we construct WSDL for a method that takes no parameters - you get an empty element. 

If you can suggest a better way to code the element definition, one that will not cause this problem to occur, then that would be a satisfactory solution.

Just coding <xs:element name="testTriggerEvent"/> is no better, by the way.

Reproduce code:

echo phpversion('sdo') . "\n";
$wsdl = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="" 
      <xs:element name="testTriggerEvent">


$xmldas            = SDO_DAS_XML::create('bug.wsdl');
$doc               = $xmldas->createDocument('testTriggerEvent');
$root              = $doc->getRootDataObject();
$serialized_root   = serialize ($root);
$unserialized_root = unserialize($serialized_root);

Expected result:
I expect the object to de-serialize without any bother and definitely no exception to be thrown.

Actual result:
<br />
<b>Fatal error</b>:  Uncaught exception 'SDO_Exception' with message 'The referenced object is null ' in C:\Program Files\Apache Group\Apache2\htdocs\MyService\AnnotationTest\bug.php:23
Stack trace:
#0 C:\Program Files\Apache Group\Apache2\htdocs\MyService\AnnotationTest\bug.php(23): unserialize('C:18:&quot;SDO_DataO...')
#1 C:\Program Files\Zend\ZendStudioClient-5.1.0\bin\php5\dummy.php(1): include('C:\Program File...')
#2 {main}
  thrown in <b>C:\Program Files\Apache Group\Apache2\htdocs\MyService\AnnotationTest\bug.php</b> on line <b>23</b><br />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-17 10:55 UTC]
I've discussed this with the Apache Tuscany folks, and we've determined that the problem is that the targetNamespace is missing from the serialized form. The consequence was that when the data was unserialized, there was apparently no root data object, and this caused the exception. 

I've checked in an update for this to CVS HEAD, which fixes your testcase for me. Could you try this out, please?
 [2006-11-17 11:30 UTC]
Thank you, much better. All my tests run cleanly now.
 [2006-11-17 12:08 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed May 31 04:03:40 2023 UTC