1--TEST--
2Access on NULL pointer in array_merge_recursive()
3--FILE--
4<?php
5try {
6    array_merge_recursive(
7        ['' => [PHP_INT_MAX => null]],
8        ['' => [null]],
9    );
10} catch (Throwable $e) {
11    echo $e->getMessage(), "\n";
12}
13
14try {
15    array_merge_recursive(
16        ['foo' => [PHP_INT_MAX => null]],
17        ['foo' => str_repeat('a', 2)],
18    );
19} catch (Throwable $e) {
20    echo $e->getMessage(), "\n";
21}
22?>
23--EXPECT--
24Cannot add element to the array as the next element is already occupied
25Cannot add element to the array as the next element is already occupied
26