[php-src] Issue #14732: Unexpected -nan value in ext/date/lib/astro.c

From: Date: Sun, 30 Jun 2024 10:16:03 +0000
Subject: [php-src] Issue #14732: Unexpected -nan value in ext/date/lib/astro.c
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-247187@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/14732 Author: YuanchengJiang ### Description The following code: ```php <?php $values = [ 2**50+1, ]; foreach ($values as $value) { } $script1_dataflow = $value; $time_date = array ( "13 Nov 2008" => mktime(8, 8, 8, 11, 13, 2008), ); foreach( $time_date as $date => $time ){ var_dump( date_sun_info($script1_dataflow, SUNFUNCS_RET_DOUBLE, 90) ); } ``` Resulted in this output: ``` /php-src/ext/date/lib/astro.c:268:17: runtime error: -nan is outside the range of representable values of type 'long long' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/date/lib/astro.c:268:17 ``` ### PHP Version PHP 8.4.0-dev ### Operating System ubuntu 22.04

« previous php.bugs (#247187) next »