Skip to content

Commit b9fef52

Browse files
authored
Deprecate date_sunrise and date_sunset constants (#12978)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
1 parent 49d0d7b commit b9fef52

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PHP NEWS
66
. Updated build system scripts config.guess to 2024-07-27 and config.sub to
77
2024-05-27. (Peter Kokot)
88

9+
- Date:
10+
. Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE
11+
are now deprecated. (Jorg Sowa)
12+
913
- DOM:
1014
. Fixed bug GH-15192 (Segmentation fault in dom extension
1115
(html5_serializer)). (nielsdos)

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,10 @@ PHP 8.4 UPGRADE NOTES
404404
- Date:
405405
. Calling DatePeriod::__construct(string $isostr, int $options = 0) is
406406
deprecated. Use DatePeriod::createFromISO8601String() instead.
407+
. Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and
408+
SUNFUNCS_RET_DOUBLE are now deprecated, following the deprecation of
409+
the associated date_sunset() and date_sunrise() functions in PHP 8.1.
410+
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
407411

408412
- Intl:
409413
. Calling intlcal_set() as well as calling IntlCalendar::set() with

ext/date/php_date.stub.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,21 @@
8383
/**
8484
* @var int
8585
* @cvalue SUNFUNCS_RET_TIMESTAMP
86+
* @deprecated
8687
*/
8788
const SUNFUNCS_RET_TIMESTAMP = UNKNOWN;
8889

8990
/**
9091
* @var int
9192
* @cvalue SUNFUNCS_RET_STRING
93+
* @deprecated
9294
*/
9395
const SUNFUNCS_RET_STRING = UNKNOWN;
9496

9597
/**
9698
* @var int
9799
* @cvalue SUNFUNCS_RET_DOUBLE
100+
* @deprecated
98101
*/
99102
const SUNFUNCS_RET_DOUBLE = UNKNOWN;
100103

ext/date/php_date_arginfo.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/date/tests/date_sunrise_and_sunset_basic.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ var_dump(gettype(date_sunset(time())));
2525
--EXPECTF--
2626
Basic test for date_sunrise() and date_sunset()
2727

28+
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
29+
2830
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
2931
%s %s %d %d, sunrise time : %d:%d
3032

33+
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
34+
3135
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
3236
%s %s %d %d, sunset time : %d:%d
3337

ext/reflection/tests/internal_parameter_default_value/check_all.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ foreach (get_declared_classes() as $class) {
2929

3030
?>
3131
===DONE===
32-
--EXPECT--
32+
--EXPECTF--
33+
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
34+
35+
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
3336
===DONE===

0 commit comments

Comments
 (0)