Skip to content

Commit b461c46

Browse files
committed
Use the new RETURN_THROWS() instead of just returning NULL
1 parent 87f341b commit b461c46

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/date/php_date.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ PHP_FUNCTION(localtime)
13331333

13341334
tzi = get_timezone_info();
13351335
if (!tzi) {
1336-
return;
1336+
RETURN_THROWS();
13371337
}
13381338
ts = timelib_time_ctor();
13391339
ts->tz_info = tzi;
@@ -1387,7 +1387,7 @@ PHP_FUNCTION(getdate)
13871387

13881388
tzi = get_timezone_info();
13891389
if (!tzi) {
1390-
return;
1390+
RETURN_THROWS();
13911391
}
13921392
ts = timelib_time_ctor();
13931393
ts->tz_info = tzi;
@@ -4483,7 +4483,7 @@ PHP_FUNCTION(date_default_timezone_get)
44834483

44844484
default_tz = get_timezone_info();
44854485
if (!default_tz) {
4486-
return;
4486+
RETURN_THROWS();
44874487
}
44884488
RETVAL_STRING(default_tz->name);
44894489
}
@@ -4542,7 +4542,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
45424542
/* Initialize time struct */
45434543
tzi = get_timezone_info();
45444544
if (!tzi) {
4545-
return;
4545+
RETURN_THROWS();
45464546
}
45474547
t = timelib_time_ctor();
45484548
t->tz_info = tzi;
@@ -4616,7 +4616,7 @@ PHP_FUNCTION(date_sun_info)
46164616
/* Initialize time struct */
46174617
tzi = get_timezone_info();
46184618
if (!tzi) {
4619-
return;
4619+
RETURN_THROWS();
46204620
}
46214621
t = timelib_time_ctor();
46224622
t->tz_info = tzi;

0 commit comments

Comments
 (0)