note 40757 added to function.unserialize

From: Date: Sat, 13 Mar 2004 15:42:43 +0000
Subject: note 40757 added to function.unserialize
Groups: php.notes 
Request: Send a blank email to php-notes+get-66769@lists.php.net to get a copy of this message
If a a string is unserializeable FALSE is returned as well as an E_NOTICE error. This is odd since you may want to know if a given string converts back to a PHP value and act accordingly. If you run your script with E_ALL reporting this will show up. I noticed this debugging this line of code: $b = unserialize(base64_decode($a)); Curiously, base64_decode() does not throw errors if the string can't be decoded. The only workaround is to prepend the @ operator to unserialize() or to change the error level. ---- Manual Page -- http://www.php.net/manual/en/function.unserialize.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40757 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40757&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40757&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66769) next »