[GIT-PULLS] [php-src] PR #22871: Guard var_dump()/debug_zval_dump() against native stack overflow
[email protected] (iliaal) Thu, 23 Jul 2026 14:05:20 +0000
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <[email protected]> |
Pull Request: https://github.com/php/php-src/pull/22871
Author: iliaal
A deeply nested array or object passed to var_dump() or debug_zval_dump() overflows the native C stack and segfaults. The object path of var_dump() and serialize() already guard their recursion with ZEND_CHECK_STACK_LIMIT; the array element helper and both debug_zval_dump() helpers were missing it. var_export() overflows the same way but needs a throw-based guard, left for a separate change.
$a = [];
for ($i = 0; $i < 100000; $i++) { $a = [$a]; }
var_dump($a); // SIGSEGV before this change