Req #67453 [NEW]: Allow to unserialize empty data.

From: Date: Mon, 16 Jun 2014 12:17:47 +0000
Subject: Req #67453 [NEW]: Allow to unserialize empty data.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186209@lists.php.net to get a copy of this message
From: remi Operating system: irrevelant PHP version: 5.6.0beta4 Package: SPL related Bug Type: Feature/Change Request Bug description:Allow to unserialize empty data. Description: ------------ SplDoublyLinkedList, SplObjectStorage and ArrayObject have empty constructor (no arg), so it make sense to allow to unserialize empty data. This also the hack (used in various place, including PHPUnit) to instanciate class without call to constructor to work. Test script: --------------- $a = new ArrayObject(array()); $a->unserialize(""); Expected result: ---------------- No error Actual result: -------------- Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Empty serialized string cannot be empty' in ... -- Edit bug report at https://bugs.php.net/bug.php?id=67453&edit=1 --

« previous php.bugs (#186209) next »