Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1892 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12743 invoked from network); 22 May 2003 14:39:01 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 22 May 2003 14:39:01 -0000 Received: (qmail 7469 invoked from network); 22 May 2003 14:38:53 -0000 Received: from shire.zend.office (10.1.1.11) by int.zend.com with SMTP; 22 May 2003 14:38:53 -0000 Date: Thu, 22 May 2003 17:38:53 +0300 (IDT) X-X-Sender: frodo@shire.zend.office To: Iacopo Spalletti cc: internals@lists.php.net In-Reply-To: <5.2.1.1.0.20030522132902.02c9c4a8@posta.spalletti.it> Message-ID: Organization: Zend Technologies Ltd (http://www.zend.com/) X-no-productlinks: yes MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Unserialize bug in PHP 4.3.2RC4? From: stas@zend.com (Stanislav Malyshev) References: <5.2.1.1.0.20030522132902.02c9c4a8@posta.spalletti.it> Strange thing - I saw this effect myself, but as soon as I have rebuilt var_unserializer.c from var_unserializer.re, it works OK again... Maybe just unclean CVS build or something? IS>> I'm testing PHP 4.3.2RC4 and i think i found a bug in unserialize function IS>> If you run this script: IS>> > error_reporting (E_ALL); IS>> $a = array(4); IS>> $str = serialize($a); IS>> print('Serialized array: '.$str."\n"); IS>> $b = unserialize($str); IS>> print('Unserialized array: '); IS>> var_dump($b); IS>> print("\n"); IS>> $str = serialize(array(4.5)); IS>> print('Serialized array: '.$str."\n"); IS>> $b = unserialize($str); IS>> print('Unserialized array: ') ; IS>> var_dump($b); IS>> print("\n"); IS>> ?> IS>> You should expect the second variable to contain an array with a single IS>> floating value. IS>> On my systems (Linux SuSE x86) i got this notice: IS>> Notice: unserialize(): Error at offset 15 of 16 bytes in script-name.php on IS>> line 12 IS>> Result for unserialize() is "false" IS>> Needless to say that on PHP 4.3.0 all run fine IS>> Serializing/deserializing float var it's ok IS>> IS>> IS>> IS>> Iacopo Spalletti IS>> i dot spalletti at iast dot it IS>> IS>> PGP key block: http://www.iast.it/pgp IS>> IS>> IS>> -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.109