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

Merge branch 'PHP-8.3' into PHP-8.4

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

2
NEWS
View File

@@ -11,6 +11,8 @@ PHP NEWS
. Fixed bug GH-18076 (Since PHP 8, the date_sun_info() function returns
inaccurate sunrise and sunset times, but other calculated times are
correct) (JiriJozif).
. Fixed bug GH-18481 (date_sunrise with unexpected nan value for the offset).
(nielsdos/David Carlier)
- Intl:
. Fix various reference issues. (nielsdos)

View File

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