Skip to content

Commit d4d4a4a

Browse files
committed
ext/date: Deprecate SUNFUNCS_RET_{STRING,DOUBLE,TIMESTAMP} constants
Deprecates constants: - SUNFUNCS_RET_STRING - SUNFUNCS_RET_TIMESTAMP - SUNFUNCS_RET_DOUBLE They are only used for parameters of date_sun_info() function, which is deprecated since PHP 8.1
1 parent f47b7f1 commit d4d4a4a

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ PHP 8.4 UPGRADE NOTES
278278
- Date:
279279
. Calling DatePeriod::__construct(string $isostr, int $options = 0) is
280280
deprecated. Use DatePeriod::createFromISO8601String() instead.
281+
. SUNFUNCS_RET_STRING, SUNFUNCS_RET_DOUBLE, and SUNFUNCS_RET_TIMESTAMP
282+
constants are deprecated. They are only used as parameters to the
283+
date_sunrise() and date_sunset() function, which are deprecated
284+
since PHP 8.1.
281285

282286
- Intl:
283287
. 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 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 in %s on line %d
3236
%s %s %d %d, sunset time : %d:%d
3337

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
SUNFUNCS_RET_STRING, SUNFUNCS_RET_DOUBLE, and SUNFUNCS_RET_TIMESTAMP constants are deprecated
3+
--FILE--
4+
<?php
5+
6+
var_dump(SUNFUNCS_RET_STRING);
7+
var_dump(SUNFUNCS_RET_DOUBLE);
8+
var_dump(SUNFUNCS_RET_TIMESTAMP);
9+
10+
?>
11+
--EXPECTF--
12+
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in %s on line %d
13+
int(1)
14+
15+
Deprecated: Constant SUNFUNCS_RET_DOUBLE is deprecated in %s on line %d
16+
int(2)
17+
18+
Deprecated: Constant SUNFUNCS_RET_TIMESTAMP is deprecated in %s on line %d
19+
int(0)

0 commit comments

Comments
 (0)