#32536 [Opn->Csd]: Unserialize() and booleans

From: Date: Fri, 01 Apr 2005 15:14:39 +0000
Subject: #32536 [Opn->Csd]: Unserialize() and booleans
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969367219@lists.php.net to get a copy of this message
ID: 32536 Updated by: vrana@php.net Reported By: AxelLuttgens at swing dot be -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: n/a PHP Version: 4.3.10 New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2005-04-01 17:09:05] AxelLuttgens at swing dot be Description: ------------ The docs state that unserialize() may return an integer, float, string, array or object. But it may also return a boolean: $bool = TRUE; $serbool = serialize($bool); $unserbool = unserialize($serbool); echo $serbool, '/', gettype($unserbool), '/', $unserbool? 'TRUE': 'FALSE'; --> b:1;/boolean/TRUE Changing TRUE to FALSE in the above yields: --> b:0;/boolean/FALSE The problem is that a FALSE value is by itself undistinguishable from an unserialization error, not that unserialize() cant' return a boolean. HTH, Axel ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32536&edit=1

« previous php.doc (#969367219) next »