Doc #80822 [Com]: signature of ArrayObject::exchangeArray($array) has changed
| From: | ievgen dot varava at spryker dot com | Date: | Wed, 03 Mar 2021 00:37:47 +0000 |
| Subject: | Doc #80822 [Com]: signature of ArrayObject::exchangeArray($array) has changed | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18612@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80822&edit=1
ID: 80822
Comment by: ievgen dot varava at spryker dot com
Reported by: ievgen dot varava at spryker dot com
Summary: signature of ArrayObject::exchangeArray($array) has
changed
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: OS X
PHP Version: 8.0.2
Block user comment: N
Private report: N
New Comment:
Also, passing invalid parameter throws TypeError in PHP8 vs InvalidArgumentException in PHP7
<?php
$a = new ArrayObject();
$a->exchangeArray(123);
?>
Previous Comments:
------------------------------------------------------------------------
[2021-03-03 00:20:04] ievgen dot varava at spryker dot com
Description:
------------
---
From manual page: https://php.net/arrayobject.exchangearray
---
Signature of ArrayObject::exchangeArray($array) has changed, but is not documented. Some code that
worked in php7 might become incompatible with php8
Test script:
---------------
<?php
interface intA {
public function exchangeArray($param);
}
class classB extends ArrayObject implements intA {}
?>
Expected result:
----------------
no errors (works in php 7.4.13)
Actual result:
--------------
Fatal error: Declaration of ArrayObject::exchangeArray(object|array $array) must be compatible with
intA::exchangeArray($param)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80822&edit=1