php-src/Zend/tests/array_merge_recursive_next_key_overflow.phpt
2023-05-24 13:36:52 +02:00

26 lines
577 B
PHP

--TEST--
Access on NULL pointer in array_merge_recursive()
--FILE--
<?php
try {
array_merge_recursive(
['' => [PHP_INT_MAX => null]],
['' => [null]],
);
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
}
try {
array_merge_recursive(
['foo' => [PHP_INT_MAX => null]],
['foo' => str_repeat('a', 2)],
);
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot add element to the array as the next element is already occupied
Cannot add element to the array as the next element is already occupied