-
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
Draft
Girgias
wants to merge
9
commits into
php:master
Choose a base branch
from
Girgias:2026-08-8.6-deprecations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Implement 8.6 deprecations #23074
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e279251
Zend: deprecate naming a function readonly
Girgias d59475b
standard: deprecate passing an object to array_walk{_recursive}()
Girgias d9df233
zlib: deprecate passing objects as array
Girgias 0571897
bz2: deprecate passing objects as array
Girgias dbbf2d2
mbstring: deprecate passing objects as vars to mb_convert_variables()
Girgias 57a6c6b
standard: deprecate aliases with non canonical type name
Girgias 4dd8f52
standard: deprecate strcoll and SORT_LOCALE_STRING
Girgias a5a6139
Zend: move builtin function tests into subfolder
Girgias 95cd7c5
Zend: deprecate passing a 3rd argument to define()
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
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); | ||
|
|
||
| ?> | ||
| --EXPECT-- | ||
| 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 /home/girgias/Dev/php-src/Zend/tests/builtin_functions/define_arg_3.php on line 3 | ||
|
|
||
| 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 /home/girgias/Dev/php-src/Zend/tests/builtin_functions/define_arg_3.php on line 3 | ||
| 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 /home/girgias/Dev/php-src/Zend/tests/builtin_functions/define_arg_3.php on line 11 | ||
| 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.