Skip to content

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

Closed

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

Activity

  1. changed the title [-]Unexpected INF value in date_sunset with large value[/-] [+]Unhandled INF in date_sunset() with tiny $utcOffset[/+] on Oct 17, 2024
  2. added a commit that references this issue on Oct 17, 2024
    c86b8ba
  3. added 4 commits that reference this issue on Oct 18, 2024
    64f312f
    66fe549
    a920afd
    9bc3418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions