[php-src] Issue #20966: UBSan: date_sun_info() triggers undefined behavior with PHP_INT_MAX arguments (NaN to long long cast)

From: Date: Sun, 18 Jan 2026 15:07:45 +0000
Subject: [php-src] Issue #20966: UBSan: date_sun_info() triggers undefined behavior with PHP_INT_MAX arguments (NaN to long long cast)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-251563@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/20966 Author: arshidkv12 ### Description The following code: ```php <?php var_dump(date_sun_info( 140, PHP_INT_MAX ,PHP_INT_MAX)); ``` Resulted in this output: ``` var_dump(date_sun_info( 140, PHP_INT_MAX ,PHP_INT_MAX)); ``` But I expected this output instead: ``` array(9) { 'sunrise' => int(0) 'sunset' => int(0) 'transit' => int(0) 'civil_twilight_begin' => int(0) 'civil_twilight_end' => int(0) 'nautical_twilight_begin' => int(0) 'nautical_twilight_end' => int(0) 'astronomical_twilight_begin' => int(0) 'astronomical_twilight_end' => int(0) } ``` ### PHP Version ```plain PHP 8.6.0-dev (cli) (built: Jan 18 2026 17:43:31) (NTS DEBUG) Copyright (c) The PHP Group Zend Engine v4.6.0-dev, Copyright (c) Zend Technologies with Zend OPcache v8.6.0-dev, Copyright (c), by Zend Technologies ``` ### Operating System _No response_

« previous php.bugs (#251563) next »