Description
var_dump() reports the correct array count for non-list arrays, but drops every element from the printed body. The underlying array data still exists (count() and array_key_exists() keep working), so this looks like a debug/runtime formatting bug specific to associative and sparse arrays.
Steps to reproduce
<?php var_dump(["x" => 1]);
A second minimal variant shows the same bug for sparse integer keys:
<?php var_dump([2 => "b"]);
Expected behavior
PHP 8.4.19 prints the array entries, including their keys and values:
array(1) {
["x"]=>
int(1)
}
and:
array(1) {
[2]=>
string(1) "b"
}
Actual behavior
Elephc prints an empty array body while still reporting the right element count:
Notes
The data itself appears to survive internally. This program still prints 1,yes under Elephc:
<?php $a = ["x" => 1]; echo count($a), ",", array_key_exists("x", $a) ? "yes" : "no";
Environment
- Elephc commit:
02ffd63c0efdd8b5dd4069e0b6bd58dfe2a9325d
- PHP:
8.4.19
- OS:
Darwin 25.5.0 arm64
- Reproduced on:
2026-06-04T07:05:57Z
Description
var_dump()reports the correct array count for non-list arrays, but drops every element from the printed body. The underlying array data still exists (count()andarray_key_exists()keep working), so this looks like a debug/runtime formatting bug specific to associative and sparse arrays.Steps to reproduce
A second minimal variant shows the same bug for sparse integer keys:
Expected behavior
PHP 8.4.19 prints the array entries, including their keys and values:
and:
Actual behavior
Elephc prints an empty array body while still reporting the right element count:
Notes
The data itself appears to survive internally. This program still prints
1,yesunder Elephc:Environment
02ffd63c0efdd8b5dd4069e0b6bd58dfe2a9325d8.4.19Darwin 25.5.0 arm642026-06-04T07:05:57Z