Bug #70153 [PATCH]: \DateInterval incorrectly unserialized
Edit report at https://bugs.php.net/bug.php?id=70153&edit=1
ID: 70153
Patch added by: cmb@php.net
Reported by: php dot net at artursvonda dot lv
Summary: \DateInterval incorrectly unserialized
Status: Open
Type: Bug
Package: Date/time related
Operating System: Ubuntu
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: dateinterval-unserialize
Revision: 1438007244
URL: https://bugs.php.net/patch-display.php?bug=70153&patch=dateinterval-unserialize&revision=1438007244
Previous Comments:
------------------------------------------------------------------------
[2015-07-27 13:26:47] php dot net at artursvonda dot lv
Description:
------------
When unserialising DateInterval, boolean fields are stored as integers.
http://3v4l.org/RkMGa
Test script:
---------------
$interval = \DateInterval::createFromDateString('+1 month');
var_dump($interval->days === false);
var_dump(unserialize(serialize($interval))->days === false);
Expected result:
----------------
bool(true)
bool(true)
Actual result:
--------------
bool(true)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70153&edit=1
Thread (6 messages)