Skip to content

Unhandled INF in date_sunset() with tiny $utcOffset #16454

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
$inputs = array (
"US/Alaska" => array ("Latitude" => 61, "Longitude" => -150 , "GMT" => -PHP_FLOAT_MAX),
);
foreach($inputs as $timezone => $value) {
var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"]) );
}

Resulted in this output:

/php-src/ext/date/php_date.c:5522:40: runtime error: inf is outside the range of representable values of type 'int'

PHP Version

nightly

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions