- Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
- 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)
}
}