Skip to content

Commit 29f98e7

Browse files
TimWollaGirgiasnielsdos
authored
Replace @deprecated by #[\Deprecated] for internal functions / class constants (#14750)
Co-authored-by: Gina Peter Banyard <[email protected]> Co-authored-by: Niels Dossche <[email protected]>
1 parent 6bb9600 commit 29f98e7

File tree

153 files changed

+1413
-600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+1413
-600
lines changed

Zend/tests/bug69802_2.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $r = new ReflectionMethod($f, '__invoke');
77
var_dump($r->getParameters()[0]->getClass());
88
?>
99
--EXPECTF--
10-
Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
10+
Deprecated: Method ReflectionParameter::getClass() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d
1111
object(ReflectionClass)#4 (1) {
1212
["name"]=>
1313
string(11) "Traversable"

Zend/tests/type_declarations/callable_002.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ var_dump($rc->getParameters()[0]->isCallable());
2121

2222
?>
2323
--EXPECTF--
24-
Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
24+
Deprecated: Method ReflectionParameter::isCallable() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d
2525
bool(true)
2626

27-
Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
27+
Deprecated: Method ReflectionParameter::isCallable() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d
2828
bool(true)
2929

30-
Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
30+
Deprecated: Method ReflectionParameter::isCallable() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d
3131
bool(true)

ext/date/php_date.c

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "ext/standard/info.h"
2121
#include "ext/standard/php_versioning.h"
2222
#include "php_date.h"
23+
#include "zend_attributes.h"
2324
#include "zend_interfaces.h"
2425
#include "zend_exceptions.h"
2526
#include "lib/timelib.h"

ext/date/php_date.stub.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ function checkdate(int $month, int $day, int $year): bool {}
120120

121121
/**
122122
* @refcount 1
123-
* @deprecated
124123
*/
124+
#[\Deprecated(since: '8.1', message: 'use IntlDateFormatter::format() instead')]
125125
function strftime(string $format, ?int $timestamp = null): string|false {}
126126

127127
/**
128128
* @refcount 1
129-
* @deprecated
130129
*/
130+
#[\Deprecated(since: '8.1', message: 'use IntlDateFormatter::format() instead')]
131131
function gmstrftime(string $format, ?int $timestamp = null): string|false {}
132132

133133
function time(): int {}
@@ -260,17 +260,17 @@ function date_default_timezone_get(): string {}
260260

261261
/**
262262
* @refcount 1
263-
* @deprecated
264263
*/
264+
#[\Deprecated(since: '8.1', message: 'use date_sun_info() instead')]
265265
function date_sunrise(
266266
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
267267
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
268268
?float $utcOffset = null): string|int|float|false {}
269269

270270
/**
271271
* @refcount 1
272-
* @deprecated
273272
*/
273+
#[\Deprecated(since: '8.1', message: 'use date_sun_info() instead')]
274274
function date_sunset(
275275
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
276276
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,

ext/date/php_date_arginfo.h

+50-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/date/tests/009.phpt

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,29 @@ var_dump(gmstrftime("blah", $t));
2323
echo "Done\n";
2424
?>
2525
--EXPECTF--
26-
Deprecated: Function strftime() is deprecated in %s on line %d
26+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2727
bool(false)
2828

29-
Deprecated: Function strftime() is deprecated in %s on line %d
29+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3030
string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s
3131
%s %"
3232

33-
Deprecated: Function strftime() is deprecated in %s on line %d
33+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3434
string(5) "%q %a"
3535

36-
Deprecated: Function strftime() is deprecated in %s on line %d
36+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3737
string(4) "blah"
3838

39-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
39+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4040
bool(false)
4141

42-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
42+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4343
string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s
4444
%s %"
4545

46-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
46+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4747
string(5) "%q %a"
4848

49-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
49+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5050
string(4) "blah"
5151
Done

ext/date/tests/009_win32.phpt

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,27 @@ echo "Done\n";
3535
setlocale(LC_TIME, $loc);
3636
?>
3737
--EXPECTF--
38-
Deprecated: Function strftime() is deprecated in %s on line %d
38+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3939
bool(false)
4040

41-
Deprecated: Function strftime() is deprecated in %s on line %d
41+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4242
string(%d) "Tue Tuesday Jun June 6/27/2006 12:00:00 AM 27 00 12 178 06 00 AM 00 26 26 2 6/27/2006 12:00:00 AM 06 2006 %s"
4343

44-
Deprecated: Function strftime() is deprecated in %s on line %d
44+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4545
string(5) "%q %a"
4646

47-
Deprecated: Function strftime() is deprecated in %s on line %d
47+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4848
string(4) "blah"
4949

50-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
50+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5151
bool(false)
5252

53-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
53+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5454
string(%d) "Mon Monday Jun June 6/26/2006 9:00:00 PM 26 21 09 177 06 00 PM 00 26 26 1 6/26/2006 9:00:00 PM 06 2006 %s"
5555

56-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
56+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5757
string(5) "%q %a"
5858

59-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
59+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6060
string(4) "blah"
6161
Done

ext/date/tests/bug65371.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ p('あ');
1919
--EXPECTF--
2020
2121

22-
Deprecated: Function strftime() is deprecated in %s on line %d
22+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2323
2424
e38182
2525

26-
Deprecated: Function strftime() is deprecated in %s on line %d
26+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2727
e38182

ext/date/tests/date_sunrise_and_sunset_basic.phpt

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ var_dump(gettype(date_sunset(time())));
2525
--EXPECTF--
2626
Basic test for date_sunrise() and date_sunset()
2727

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

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

34-
Deprecated: Function date_sunrise() is deprecated in %s on line %d
34+
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
3535
string(6) "string"
3636

37-
Deprecated: Function date_sunset() is deprecated in %s on line %d
37+
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
3838
string(6) "string"

ext/date/tests/date_sunrise_and_sunset_error.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ try {
1717

1818
?>
1919
--EXPECTF--
20-
Deprecated: Function date_sunrise() is deprecated in %s on line %d
20+
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
2121
date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
2222

23-
Deprecated: Function date_sunset() is deprecated in %s on line %d
23+
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
2424
date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE

ext/date/tests/gmstrftime_basic.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ var_dump( gmstrftime($format) );
1818
--EXPECTF--
1919
*** Testing gmstrftime() : basic functionality ***
2020

21-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
21+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2222
string(20) "Aug 08 2008 08:08:08"
2323

24-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
24+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2525
string(%d) "%s %d %d %d:%d:%d"

ext/date/tests/gmstrftime_variation10.phpt

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ foreach($inputs as $key =>$value) {
3535

3636
--The ISO 8601:1988 week number--
3737

38-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
38+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3939
string(%d) "%d"
4040

41-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
41+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4242
string(2) "32"
4343

4444
--Weekday as decimal--
4545

46-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
46+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4747
string(%d) "%d"
4848

49-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
49+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5050
string(1) "5"

ext/date/tests/gmstrftime_variation11.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ var_dump( gmstrftime($format, $timestamp) );
2020

2121
-- Testing gmstrftime() function with Abbreviated month name format %h --
2222

23-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
23+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2424
string(%d) "%s"
2525

26-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
26+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2727
string(3) "Aug"

ext/date/tests/gmstrftime_variation12.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ var_dump( gmstrftime($format, $timestamp) );
2626

2727
-- Testing gmstrftime() function with Abbreviated month name format %h --
2828

29-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
29+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3030
string(%d) "%s"
3131

32-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
32+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3333
string(3) "Aug"

ext/date/tests/gmstrftime_variation13.phpt

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@ foreach($inputs as $key =>$value) {
3131

3232
--Century number--
3333

34-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
34+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3535
string(2) "%d"
3636

37-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
37+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3838
string(2) "20"
3939

4040
--Month Date Year--
4141

42-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
42+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4343
string(%d) "%d/%d/%d"
4444

45-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
45+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4646
string(8) "08/08/08"
4747

4848
--Year with century--
4949

50-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
50+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5151
string(%d) "%d"
5252

53-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
53+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5454
string(4) "2008"
5555

5656
--Year without century--
5757

58-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
58+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5959
string(2) "%d"
6060

61-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
61+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6262
string(2) "08"

ext/date/tests/gmstrftime_variation14.phpt

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,32 @@ foreach($inputs as $key =>$value) {
3737

3838
--Century number--
3939

40-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
40+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4141
string(%d) "%d"
4242

43-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
43+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4444
string(2) "20"
4545

4646
--Month Date Year--
4747

48-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
48+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4949
string(%d) "%d/%d/%d"
5050

51-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
51+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5252
string(8) "08/08/08"
5353

5454
--Year with century--
5555

56-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
56+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5757
string(%d) "%d"
5858

59-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
59+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6060
string(4) "2008"
6161

6262
--Year without century--
6363

64-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
64+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6565
string(%d) "%d"
6666

67-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
67+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6868
string(2) "08"

0 commit comments

Comments
 (0)