[wp-trac] [WordPress Trac] #64047: PHP 8.5: NAN coercion warnings

WordPress Trac noreply at wordpress.org
Mon Sep 29 10:56:27 UTC 2025


#64047: PHP 8.5: NAN coercion warnings
-------------------------------+-------------------------------
 Reporter:  swissspidy         |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  6.9
Component:  General            |    Version:
 Severity:  normal             |   Keywords:  needs-patch php85
  Focuses:  php-compatibility  |
-------------------------------+-------------------------------
 Parent ticket for all things PHP 8.5: #63061

 ----

 These are new warnings when testing against PHP 8.5. Should probably add
 some `is_nan()` checks or remove the edge case tests.

 {{{
 2) Tests_Media::test_wp_convert_bytes_to_hr
 The float NAN is not representable as an int, cast occurred

 /var/www/src/wp-includes/deprecated.php:3374
 /var/www/tests/phpunit/tests/media.php:498
 /var/www/vendor/bin/phpunit:122

 9)
 Tests_Option_WpPrimeOptionCaches::test_get_option_should_return_identical_value_when_pre_primed_by_wp_prime_option_caches
 with data set "NAN" (NAN)
 unexpected NAN value was coerced to string

 /var/www/src/wp-includes/class-wpdb.php:1763
 /var/www/src/wp-includes/option.php:1143
 /var/www/tests/phpunit/tests/option/wpPrimeOptionCaches.php:251
 /var/www/vendor/bin/phpunit:122
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64047>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list