Bug #75942 [NEW]: Backward incompatibility introduced in RecursiveArrayIterator
| From: | andries at centim dot be | Date: | Fri, 09 Feb 2018 07:56:25 +0000 |
| Subject: | Bug #75942 [NEW]: Backward incompatibility introduced in RecursiveArrayIterator | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-213881@lists.php.net to get a copy of this message | ||
From: andries at centim dot be
Operating system: any
PHP version: 7.1.14
Package: SPL related
Bug Type: Bug
Bug description:Backward incompatibility introduced in RecursiveArrayIterator
Description:
------------
I'm referencing to ticket https://bugs.php.net/bug.php?id=73209 that was
fixed in PHP 7.1.14, and seems to have introduced a backward
compatibility issue compared to PHP 7.1.13. I'm creating a new ticket,
as this ticket was already closed.
When RecursiveArrayIterator is used in combination with a
RecursiveIteratorIterator, and your class has a public property that
contains a DateTime instance, it will crash with the following error:
Overloaded object of type DateTime is not compatible with
RecursiveArrayIterator
This did not produce an error on PHP 7.1.13,
Was it a bug that it didn't iterate object properties? Or is supporting
it a new feature? I lean toward the latter without having seen the spec,
but either way the current fix breaks backward compatibility.
Test script:
---------------
https://gist.github.com/andriesss/b22b4057bd7e0563f4d21b7b2cfd6a09
--
Edit bug report at https://bugs.php.net/bug.php?id=75942&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75942&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75942&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75942&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75942&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75942&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75942&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75942&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75942&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75942&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75942&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75942&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75942&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75942&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75942&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75942&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75942&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75942&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75942&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75942&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75942&r=mysqlcfg