[php-src] PR #23668: Fix GH-23662: avoid NAN warning in print_r()
| From: | CodedByManish | Date: | Sat, 12 Sep 2026 06:24:49 +0000 |
| Subject: | [php-src] PR #23668: Fix GH-23662: avoid NAN warning in print_r() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38451@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23668
Author: CodedByManish
Fixes #23662.
print_r() currently converts double values through string coercion, which
causes a warning when the value is NAN.
Handle IS_DOUBLE directly in zend_print_zval_r_to_buf() using
smart_str_append_double(), so print_r() formats the value without
triggering a coercion warning.
Added a regression test covering print_r([NAN]).
Tested with:
./sapi/cli/php -n run-tests.php Zend/tests/gh23662.phpt
Result: PASS.