mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

SplFixedArray should've never get supported in ArrayObject because it's
overloaded, and so that breaks assumptions. This regressed in c4ecd82f
.
Closes GH-15947.
16 lines
461 B
PHP
16 lines
461 B
PHP
--TEST--
|
|
SplFixedArray properties is incompatible with ArrayObject
|
|
--FILE--
|
|
<?php
|
|
$ao = new ArrayObject([1, 2, 3]);
|
|
$fixedArray = new SplFixedArray(1);
|
|
$fixedArray[0] = new SplDoublyLinkedList();
|
|
try {
|
|
// See GH-15918: this *should* fail to not break invariants
|
|
$ao->exchangeArray($fixedArray);
|
|
} catch (InvalidArgumentException $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Overloaded object of type SplFixedArray is not compatible with ArrayObject
|