rfc:deprecations_php_8_5
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:deprecations_php_8_5 [2024/11/05 09:27] – Formally deprecate mysqli_execute timwolla | rfc:deprecations_php_8_5 [2024/11/28 17:47] (current) – Add exclude_disabled param deprecation girgias | ||
---|---|---|---|
Line 18: | Line 18: | ||
* Make '' | * Make '' | ||
* Deprecate FILTER_CALLBACK filter | * Deprecate FILTER_CALLBACK filter | ||
- | * Deprecate < | + | * Deprecate < |
* Deprecate the '' | * Deprecate the '' | ||
* Deprecate the '' | * Deprecate the '' | ||
* Deprecate the '' | * Deprecate the '' | ||
+ | * Deprecate the '' | ||
* Formally deprecate mysqli_execute | * Formally deprecate mysqli_execute | ||
+ | * Deprecate < | ||
+ | * Deprecate semicolon after '' | ||
+ | * Deprecate the < | ||
===== Proposal ===== | ===== Proposal ===== | ||
Line 78: | Line 82: | ||
- | ==== Deprecate filter_input() | + | ==== Deprecate filter_input(), filter_input_array(), and filter_has_var() ==== |
Author: Gina Peter Banyard < | Author: Gina Peter Banyard < | ||
Line 129: | Line 133: | ||
and < | and < | ||
we propose to deprecate < | we propose to deprecate < | ||
+ | |||
+ | As < | ||
+ | but has the same caveat as the two previous functions, we propose to also deprecate this function. | ||
==== Deprecate the docref_root and docref_ext INI directives ==== | ==== Deprecate the docref_root and docref_ext INI directives ==== | ||
Line 163: | Line 170: | ||
This " | This " | ||
Because this cannot affect production builds of PHP we propose deprecating this INI setting. | Because this cannot affect production builds of PHP we propose deprecating this INI setting. | ||
+ | |||
+ | ==== Deprecate the register_argc_argv INI directive ==== | ||
+ | |||
+ | Author: Nicolas Grekas < | ||
+ | |||
+ | This INI directive tells PHP whether to declare the argv & argc variables. On the CLI, phpdbg and embed SAPIs it is forced to On. It defaults to Off on other SAPIs. This setting is dangerous on HTTP SAPIs because it allows defining the value of the argv/argc variables from the query string. This is almost always unwanted and certainly unexpected. It can lead to security issues if one reads argv/argc from an HTTP apps while not being aware of this behavior. | ||
+ | |||
+ | We propose to deprecate this INI setting and make in default to Off in PHP 8.5, then to hardcode it to Off for all non-CLI-related SAPIs on PHP 9 (while keeping it hardcoded to On for CLI-related ones). | ||
==== Formally deprecate mysqli_execute ==== | ==== Formally deprecate mysqli_execute ==== | ||
Line 169: | Line 184: | ||
TODO: https:// | TODO: https:// | ||
+ | |||
+ | ==== Deprecate __construct() and __destruct() in interfaces ==== | ||
+ | |||
+ | Author: Tim Düsterhus < | ||
+ | |||
+ | TODO: https:// | ||
+ | |||
+ | ==== Deprecate semicolon after case in switch statement ==== | ||
+ | |||
+ | Author: Theodore Brown < | ||
+ | |||
+ | It is possible to terminate '' | ||
+ | |||
+ | <PHP> | ||
+ | switch ($value) { | ||
+ | case ' | ||
+ | case ' | ||
+ | case ' | ||
+ | echo 'foo, bar, or baz'; | ||
+ | break; | ||
+ | default; | ||
+ | echo ' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | This syntax is a leftover from PHP/FI 2, where nearly all lines including if conditions and case statements were terminated by a semicolon. [[https:// | ||
+ | |||
+ | There isn't a need for this syntax to exist anymore, and very few PHP developers are even aware of its existence. In the top 1000 Composer packages, zero out of 35,777 total case statements are using the alternate syntax (as of 2024-11-27). | ||
+ | |||
+ | Case statements followed by a semicolon can cause confusion, as a developer may think they behave differently in some way from regular case statements (e.g. preventing fallthrough), | ||
+ | |||
+ | Therefore, we propose to deprecate terminating case statements with a semicolon. | ||
+ | |||
+ | |||
+ | ==== Deprecate the $exclude_disabled parameter of get_defined_functions() ==== | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | As of PHP 8.0.0, functions that are disabled via the '' | ||
+ | As such, this parameter has no longer any effect and is pointless. | ||
+ | Therefore, we propose to deprecate it. | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== |
rfc/deprecations_php_8_5.1730798843.txt.gz · Last modified: 2024/11/05 09:27 by timwolla