Unserialize bug in PHP 4.3.2RC4?
| From: | Iacopo Spalletti | Date: | Thu, 22 May 2003 14:30:49 +0000 |
| Subject: | Unserialize bug in PHP 4.3.2RC4? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-1891@lists.php.net to get a copy of this message | ||
I'm testing PHP 4.3.2RC4 and i think i found a bug in unserialize function
If you run this script:
<?php
error_reporting (E_ALL);
$a = array(4); $str = serialize($a);print('Serialized array: '.$str."\n");
$b = unserialize($str);print('Unserialized array: '); var_dump($b); print("\n");
$str = serialize(array(4.5));print('Serialized array: '.$str."\n");
$b = unserialize($str);print('Unserialized array: ') ; var_dump($b); print("\n"); ?> You should expect the second variable to contain an array with a single floating value. On my systems (Linux SuSE x86) i got this notice: Notice: unserialize(): Error at offset 15 of 16 bytes in script-name.php on line 12 Result for unserialize() is "false" Needless to say that on PHP 4.3.0 all run fine Serializing/deserializing float var it's ok Iacopo Spalletti i dot spalletti at iast dot it PGP key block: http://www.iast.it/pgp