1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.4'

This commit is contained in:
David Carlier
2025-05-03 16:56:55 +01:00
2 changed files with 22 additions and 1 deletions

View File

@@ -5516,7 +5516,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, bool calc_s
if (N > 24 || N < 0) { if (N > 24 || N < 0) {
N -= floor(N / 24) * 24; N -= floor(N / 24) * 24;
} }
if (N > 24 || N < 0) { if (!(N <= 24 && N >= 0)) {
RETURN_FALSE; RETURN_FALSE;
} }

View File

@@ -0,0 +1,21 @@
--TEST--
GH-18481 (date_sunrise with utcOffset as INF)
--FILE--
<?php
foreach ([-NAN, NAN, INF, -INF] as $offset) {
var_dump(date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, $offset));
}
?>
--EXPECTF--
Deprecated: Function date_sunrise() is deprecated in %s on line %d
bool(false)
Deprecated: Function date_sunrise() is deprecated in %s on line %d
bool(false)
Deprecated: Function date_sunrise() is deprecated in %s on line %d
bool(false)
Deprecated: Function date_sunrise() is deprecated in %s on line %d
bool(false)