Skip to content

Replace @deprecated by #[\Deprecated] for internal functions / class constants #14750

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 1 commit into from
Jul 10, 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
2 changes: 1 addition & 1 deletion Zend/tests/bug69802_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $r = new ReflectionMethod($f, '__invoke');
var_dump($r->getParameters()[0]->getClass());
?>
--EXPECTF--
Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
Deprecated: Method ReflectionParameter::getClass() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d
object(ReflectionClass)#4 (1) {
["name"]=>
string(11) "Traversable"
Expand Down
6 changes: 3 additions & 3 deletions Zend/tests/type_declarations/callable_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ var_dump($rc->getParameters()[0]->isCallable());

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

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

Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
Deprecated: Method ReflectionParameter::isCallable() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d
bool(true)
1 change: 1 addition & 0 deletions ext/date/php_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ext/standard/info.h"
#include "ext/standard/php_versioning.h"
#include "php_date.h"
#include "zend_attributes.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"
#include "lib/timelib.h"
Expand Down
8 changes: 4 additions & 4 deletions ext/date/php_date.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ function checkdate(int $month, int $day, int $year): bool {}

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

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

function time(): int {}
Expand Down Expand Up @@ -260,17 +260,17 @@ function date_default_timezone_get(): string {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated(since: '8.1', message: 'use date_sun_info() instead')]
function date_sunrise(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
?float $utcOffset = null): string|int|float|false {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated(since: '8.1', message: 'use date_sun_info() instead')]
function date_sunset(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
Expand Down
51 changes: 50 additions & 1 deletion ext/date/php_date_arginfo.h

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

16 changes: 8 additions & 8 deletions ext/date/tests/009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ var_dump(gmstrftime("blah", $t));
echo "Done\n";
?>
--EXPECTF--
Deprecated: Function strftime() is deprecated in %s on line %d
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
bool(false)

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

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

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

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

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(4) "blah"
Done
16 changes: 8 additions & 8 deletions ext/date/tests/009_win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ echo "Done\n";
setlocale(LC_TIME, $loc);
?>
--EXPECTF--
Deprecated: Function strftime() is deprecated in %s on line %d
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
bool(false)

Deprecated: Function strftime() is deprecated in %s on line %d
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
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"

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

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
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"

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(4) "blah"
Done
4 changes: 2 additions & 2 deletions ext/date/tests/bug65371.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ p('あ');
--EXPECTF--

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

Deprecated: Function strftime() is deprecated in %s on line %d
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
e38182
8 changes: 4 additions & 4 deletions ext/date/tests/date_sunrise_and_sunset_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ var_dump(gettype(date_sunset(time())));
--EXPECTF--
Basic test for date_sunrise() and date_sunset()

Deprecated: Function date_sunrise() 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: Function date_sunset() 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

Deprecated: Function date_sunrise() 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
string(6) "string"

Deprecated: Function date_sunset() 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
string(6) "string"
4 changes: 2 additions & 2 deletions ext/date/tests/date_sunrise_and_sunset_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ try {

?>
--EXPECTF--
Deprecated: Function date_sunrise() 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
date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE

Deprecated: Function date_sunset() 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
date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
4 changes: 2 additions & 2 deletions ext/date/tests/gmstrftime_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var_dump( gmstrftime($format) );
--EXPECTF--
*** Testing gmstrftime() : basic functionality ***

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(%d) "%s %d %d %d:%d:%d"
8 changes: 4 additions & 4 deletions ext/date/tests/gmstrftime_variation10.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ foreach($inputs as $key =>$value) {

--The ISO 8601:1988 week number--

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

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

--Weekday as decimal--

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(1) "5"
4 changes: 2 additions & 2 deletions ext/date/tests/gmstrftime_variation11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var_dump( gmstrftime($format, $timestamp) );

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(3) "Aug"
4 changes: 2 additions & 2 deletions ext/date/tests/gmstrftime_variation12.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var_dump( gmstrftime($format, $timestamp) );

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(3) "Aug"
16 changes: 8 additions & 8 deletions ext/date/tests/gmstrftime_variation13.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ foreach($inputs as $key =>$value) {

--Century number--

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

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

--Month Date Year--

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

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

--Year with century--

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

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

--Year without century--

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(2) "08"
16 changes: 8 additions & 8 deletions ext/date/tests/gmstrftime_variation14.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,32 @@ foreach($inputs as $key =>$value) {

--Century number--

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

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

--Month Date Year--

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

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

--Year with century--

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

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

--Year without century--

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

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