php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35845 deserialization problem
Submitted: 2005-12-30 01:38 UTC Modified: 2005-12-30 10:29 UTC
From: xing at mac dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.2RC1 OS: centos 4.2
Private report: No CVE-ID: None
 [2005-12-30 01:38 UTC] xing at mac dot com
Description:
------------
cannot deserialize an serialized output...

the serialized object is an array of query_result objects which contain an "result" element which is an array of simple objects.

Reproduce code:
---------------
<?

class query_result   {
	
	public $affected_rows = 0; 
	public $num_rows = 0; 
	public $insert_id = 0;

	public $result = array(); //pdo result
	public $pointer = 0;
}

$dump = unserialize(file_get_contents("dump.txt"));

if($dump == NULL) {
    echo "error";   
}
else if(is_array($dump)) {
    echo "not error";
}
else {
    echo "huh? {$dump}";
}

?>

Expected result:
----------------
not error

Actual result:
--------------
error

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-30 01:43 UTC] xing at mac dot com
dump.txt, captured serialized output, is at:

http://mirror.fictionpress.com/beans/dump.txt
 [2005-12-30 06:46 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-12-30 07:34 UTC] xing at mac dot com
Just put the dump.txt file within the same folder as the included code and run.
 [2005-12-30 10:29 UTC] tony2001@php.net
Fix your data, it's broken:
s:15:"King<92>s Blades";
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 17:01:34 2025 UTC