Skip to content

RFC: Deprecate date_sunrise and date_sunset constants #12978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ PHP NEWS
. Updated build system scripts config.guess to 2024-07-27 and config.sub to
2024-05-27. (Peter Kokot)

- Date:
. Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE
are now deprecated. (Jorg Sowa)

- DOM:
. Fixed bug GH-15192 (Segmentation fault in dom extension
(html5_serializer)). (nielsdos)
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@ PHP 8.4 UPGRADE NOTES
- Date:
. Calling DatePeriod::__construct(string $isostr, int $options = 0) is
deprecated. Use DatePeriod::createFromISO8601String() instead.
. Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and
SUNFUNCS_RET_DOUBLE are now deprecated, following the deprecation of
the associated date_sunset() and date_sunrise() functions in PHP 8.1.
RFC: https://wiki.php.net/rfc/deprecations_php_8_4

- Intl:
. Calling intlcal_set() as well as calling IntlCalendar::set() with
Expand Down
3 changes: 3 additions & 0 deletions ext/date/php_date.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,21 @@
/**
* @var int
* @cvalue SUNFUNCS_RET_TIMESTAMP
* @deprecated
*/
const SUNFUNCS_RET_TIMESTAMP = UNKNOWN;

/**
* @var int
* @cvalue SUNFUNCS_RET_STRING
* @deprecated
*/
const SUNFUNCS_RET_STRING = UNKNOWN;

/**
* @var int
* @cvalue SUNFUNCS_RET_DOUBLE
* @deprecated
*/
const SUNFUNCS_RET_DOUBLE = UNKNOWN;

Expand Down
8 changes: 4 additions & 4 deletions ext/date/php_date_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ext/date/tests/date_sunrise_and_sunset_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ var_dump(gettype(date_sunset(time())));
--EXPECTF--
Basic test for date_sunrise() and date_sunset()

Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d

Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
%s %s %d %d, sunrise time : %d:%d

Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d

Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
%s %s %d %d, sunset time : %d:%d

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ foreach (get_declared_classes() as $class) {

?>
===DONE===
--EXPECT--
--EXPECTF--
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d

Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
===DONE===
Loading