Skip to content

Commit 0f6e18d

Browse files
committed
Merge branch 'PHP-8.4'
2 parents bbac6f5 + 004d7cd commit 0f6e18d

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ext/date/php_date.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5516,7 +5516,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, bool calc_s
55165516
if (N > 24 || N < 0) {
55175517
N -= floor(N / 24) * 24;
55185518
}
5519-
if (N > 24 || N < 0) {
5519+
if (!(N <= 24 && N >= 0)) {
55205520
RETURN_FALSE;
55215521
}
55225522

ext/date/tests/gh18481.phpt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
GH-18481 (date_sunrise with utcOffset as INF)
3+
--FILE--
4+
<?php
5+
6+
foreach ([-NAN, NAN, INF, -INF] as $offset) {
7+
var_dump(date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, $offset));
8+
}
9+
?>
10+
--EXPECTF--
11+
Deprecated: Function date_sunrise() is deprecated in %s on line %d
12+
bool(false)
13+
14+
Deprecated: Function date_sunrise() is deprecated in %s on line %d
15+
bool(false)
16+
17+
Deprecated: Function date_sunrise() is deprecated in %s on line %d
18+
bool(false)
19+
20+
Deprecated: Function date_sunrise() is deprecated in %s on line %d
21+
bool(false)

0 commit comments

Comments
 (0)