-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Implement 8.6 deprecations #23074
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
Implement 8.6 deprecations #23074
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
900b4fd
Zend: deprecate naming a function readonly
Girgias 36ace27
standard: deprecate passing an object to array_walk{_recursive}()
Girgias 3eda884
zlib: deprecate passing objects as array
Girgias cc73e02
bz2: deprecate passing objects as array
Girgias 7f27e31
mbstring: deprecate passing objects as vars to mb_convert_variables()
Girgias f1d8450
standard: deprecate aliases with non canonical type name
Girgias dd78ddf
standard: deprecate strcoll and SORT_LOCALE_STRING
Girgias 17d89d8
Zend: move builtin function tests into subfolder
Girgias 4ccad7d
Zend: deprecate passing a 3rd argument to define()
Girgias ca4df96
spl: deprecate spl_object_hash()
Girgias 42cef14
spl: deprecate spl_classes()
Girgias bca9332
spl: deprecate ArrayIterator methods that make little sense
Girgias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --TEST-- | ||
| define() with 3rd argument | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| define('my_Constant', 5, true); | ||
|
|
||
| try { | ||
| var_dump(MY_CONSTANT); | ||
| } catch (Throwable $e) { | ||
| echo $e::class, ': ', $e->getMessage(), PHP_EOL; | ||
| } | ||
|
|
||
| define('MY_CONSTANT', 5, false); | ||
| var_dump(MY_CONSTANT); | ||
|
|
||
| ?> | ||
| --EXPECTF-- | ||
| Deprecated: define(): Argument #3 ($case_insensitive) is ignored and treated as false since declaration of case-insensitive constants is no longer supported, passing the argument explicitly is unnecessary in %s on line %d | ||
|
|
||
| Warning: define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported, this will be an error in PHP 9.0 in %s on line %d | ||
| Error: Undefined constant "MY_CONSTANT" | ||
|
|
||
| Deprecated: define(): Argument #3 ($case_insensitive) is ignored and treated as false since declaration of case-insensitive constants is no longer supported, passing the argument explicitly is unnecessary in %s on line %d | ||
| int(5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Zend/tests/functions/readonly_as_fn_name_is_deprecated.phpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --TEST-- | ||
| Naming a function readonly is deprecated | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| function readonly() {} | ||
|
|
||
| ?> | ||
| DONE | ||
| --EXPECTF-- | ||
| Deprecated: Calling a function “readonly” is deprecated in %s on line %d | ||
| DONE |
14 changes: 14 additions & 0 deletions
14
Zend/tests/functions/readonly_as_fn_name_is_deprecated_namespaced.phpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --TEST-- | ||
| Naming a function readonly is deprecated | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| namespace Foo; | ||
|
|
||
| function readonly() {} | ||
|
|
||
| ?> | ||
| DONE | ||
| --EXPECTF-- | ||
| Deprecated: Calling a function “readonly” is deprecated in %s on line %d | ||
| DONE |
17 changes: 17 additions & 0 deletions
17
Zend/tests/functions/readonly_as_fn_name_is_deprecated_throw_handler.phpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --TEST-- | ||
| Naming a function readonly is deprecated with an error handler elevating it to an exception | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| set_error_handler(function ($number, $message) { | ||
| throw new Exception($message); | ||
| }); | ||
|
|
||
| /* Throwing error handlers do no apply for compile time deprecations */ | ||
| function readonly() {} | ||
|
|
||
| ?> | ||
| DONE | ||
| --EXPECTF-- | ||
| Deprecated: Calling a function “readonly” is deprecated in %s on line %d | ||
| DONE | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --TEST-- | ||
| Naming a function readonly is deprecated | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| class C { | ||
| public function readonly() {} | ||
| } | ||
|
|
||
| ?> | ||
| DONE | ||
| --EXPECT-- | ||
| DONE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does wrapping the function into
if(random_int(1, 1))work? Otherwise you couldrequire __DIR__ . '/readonly_as_fn_name_is_deprecated.phpt';to reuse the other test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it doesn't do anything.