#32536 [NEW]: Unserialize() and booleans
| From: | AxelLuttgens at swing dot be | Date: | Fri, 01 Apr 2005 15:09:05 +0000 |
| Subject: | #32536 [NEW]: Unserialize() and booleans | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969367217@lists.php.net to get a copy of this message | ||
From: AxelLuttgens at swing dot be
Operating system: n/a
PHP version: 4.3.10
PHP Bug Type: Documentation problem
Bug description: Unserialize() and booleans
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 bug report at http://bugs.php.net/?id=32536&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32536&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32536&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32536&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32536&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32536&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32536&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32536&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32536&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32536&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32536&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32536&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32536&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32536&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32536&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32536&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32536&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32536&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32536&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32536&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32536&r=mysqlcfg