Behaves as expected.
array(1) {
["p"]=>
array(2) {
["id"]=>
bool(true)
[0]=>
bool(false)
}
}
OMG internal array pointer shenanigans can affect the results of array_merge_recursive()!
array(1) {
["p"]=>
array(2) {
["id"]=>
bool(true)
[1]=>
bool(false)
}
}
This keeps happening…
array(1) {
["p"]=>
array(2) {
["id"]=>
bool(true)
[1]=>
bool(false)
}
}
… not even resetting the internal array pointer helps …
array(1) {
["p"]=>
array(2) {
["id"]=>
bool(true)
[1]=>
bool(false)
}
}
… nor casting to object, cloning, then back to array …
array(1) {
["p"]=>
array(2) {
["id"]=>
bool(true)
[1]=>
bool(false)
}
}
… only forcefully recreating a copy-by-value of the array by using array_slice().
array(1) {
["p"]=>
array(2) {
["id"]=>
bool(true)
[0]=>
bool(false)
}
}
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15)
/bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.