Subject: | Bug in PHP::Serialization |
Date: | Mon, 29 Dec 2008 14:24:47 -0800 (PST) |
To: | bug-PHP-Serialization [...] rt.cpan.org |
From: | "Greg Saylor" <gregs [...] net-virtual.com> |
Hello,
The following code does not generate something PHP's unserialize can parse:
=======================
use PHP::Serialization qw(serialize unserialize);
use Data::Dumper;
my $hash = {
'Volkswagen' => {
'Touareg' => {
'2.5' => 1
}
},
};
my $str = serialize($hash);
print $str;
=======================
The string generated is
"a:1:{s:10:"Volkswagen";a:1:{s:7:"Touareg";a:1:{d:2.5;i:1;}}}", I think
the issue is that it is encoding "2.5" as a double 'd:2.5' and it should
be a string 's:3:2.5'.
Regards,
Greg Saylor