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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
21
ext/date/tests/gh18481.phpt
Normal file
21
ext/date/tests/gh18481.phpt
Normal 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)
|
||||||
Reference in New Issue
Block a user