Bug #70730 [NEW]: Incorrect ArrayObject serialization if unset is called in serialize()

From: Date: Fri, 16 Oct 2015 21:47:44 +0000
Subject: Bug #70730 [NEW]: Incorrect ArrayObject serialization if unset is called in serialize()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196653@lists.php.net to get a copy of this message
From:             eddielau224 at gmail dot com
Operating system: Mac OS X Yosemite
PHP version:      7.0.0RC5
Package:          SPL related
Bug Type:         Bug
Bug description:Incorrect ArrayObject serialization if unset is called in serialize()

Description:
------------
If a class extending ArrayObject overrides serialize() and calls unset()
on it's member variable. It's serialized string will be incorrect. In
the test script, the serialized string will contain 'm:a:1:{}', causing
'Unexpected end of serialized data'.
The test script is working in PHP 5.6

Test script:
---------------
https://3v4l.org/v353G

Expected result:
----------------
Unserialization performed without errors.

Actual result:
--------------
'Unexpected end of serialized data' notice

-- 
Edit bug report at https://bugs.php.net/bug.php?id=70730&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70730&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70730&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70730&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70730&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70730&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70730&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70730&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70730&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70730&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70730&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70730&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70730&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70730&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70730&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70730&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70730&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70730&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70730&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70730&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70730&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#196653) next »