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/10/27 21:49] – Add ext/filter deprecation and explanations girgias | rfc:deprecations_php_8_5 [2025/03/30 17:46] (current) – Add finfo_buffer() $context param girgias | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Authors: | * Authors: | ||
* Gina Peter Banyard < | * Gina Peter Banyard < | ||
- | | + | * Christoph M. Becker < |
+ | | ||
* Implementation: | * Implementation: | ||
Line 14: | Line 15: | ||
* Deprecate '' | * Deprecate '' | ||
* Deprecate PDO's ' | * Deprecate PDO's ' | ||
+ | * Deprecate PDO:: | ||
+ | * Deprecate intl.error_level INI setting | ||
* Deprecate Reflection*:: | * Deprecate Reflection*:: | ||
* Deprecate FILTER_DEFAULT constant | * Deprecate FILTER_DEFAULT constant | ||
* Make '' | * Make '' | ||
* Deprecate FILTER_CALLBACK filter | * Deprecate FILTER_CALLBACK filter | ||
+ | * Deprecate < | ||
+ | * Deprecate the '' | ||
+ | * Deprecate the '' | ||
+ | * Deprecate the '' | ||
+ | * Deprecate the '' | ||
+ | * Formally deprecate mysqli_execute | ||
+ | * Deprecate < | ||
+ | * Deprecate semicolon after '' | ||
+ | * Deprecate the < | ||
+ | * Deprecate building ext/ldap against Oracle LDAP | ||
+ | * Deprecate passing '' | ||
+ | * Deprecate the < | ||
===== Proposal ===== | ===== Proposal ===== | ||
Line 35: | Line 50: | ||
TODO: https:// | TODO: https:// | ||
+ | |||
+ | ==== Deprecate PDO:: | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | TODO: Warnings are a weird mixture of exceptions, and setting the error code. | ||
+ | |||
+ | ==== Deprecate intl.error_level INI setting ==== | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | TODO: Similar to PDO:: | ||
==== Deprecate Reflection*:: | ==== Deprecate Reflection*:: | ||
Line 71: | Line 98: | ||
As such, we propose to deprecate this filter. | As such, we propose to deprecate this filter. | ||
+ | |||
+ | |||
+ | ==== Deprecate filter_input(), | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | The < | ||
+ | |||
+ | This means that modification to any entry of the superglobal will not be used when calling these functions. | ||
+ | This is showcased by the following PHPT test: | ||
+ | |||
+ | <PHP> | ||
+ | --TEST-- | ||
+ | filter_input() filter with superglobal modified | ||
+ | --EXTENSIONS-- | ||
+ | filter | ||
+ | --GET-- | ||
+ | a=hello | ||
+ | --FILE-- | ||
+ | <?php | ||
+ | |||
+ | var_dump($_GET); | ||
+ | $f1 = filter_input(INPUT_GET, | ||
+ | var_dump($f1); | ||
+ | |||
+ | $_GET[' | ||
+ | var_dump($_GET); | ||
+ | $f2 =filter_input(INPUT_GET, | ||
+ | var_dump($f2); | ||
+ | var_dump($_GET); | ||
+ | |||
+ | ?> | ||
+ | --EXPECT-- | ||
+ | array(1) { | ||
+ | [" | ||
+ | string(5) " | ||
+ | } | ||
+ | bool(false) | ||
+ | array(1) { | ||
+ | [" | ||
+ | string(5) " | ||
+ | } | ||
+ | bool(false) | ||
+ | array(1) { | ||
+ | [" | ||
+ | string(5) " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | As it is easy and straight forward to have the same behaviour by using | ||
+ | < | ||
+ | and < | ||
+ | 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 ==== | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | Both of these INI settings allow overriding the output of HTML diagnostic errors | ||
+ | (warning, notice, deprecations, | ||
+ | pointing to functions and/or INI settings in error messages generated by calls to '' | ||
+ | |||
+ | This is a debug feature and had some value when the php.net documentation had mirrors, | ||
+ | considering those have been retired, their use is now limited. | ||
+ | |||
+ | As such, we propose deprecating those two INI settings. | ||
+ | |||
+ | |||
+ | ==== Deprecate the error_prepend_string and error_append_string INI directives ==== | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | Both of these INI settings allow overriding the output of HTML diagnostic errors | ||
+ | (warning, notice, deprecations, | ||
+ | |||
+ | This is a development and debugging feature which seems somewhat questionable and of limited use. | ||
+ | |||
+ | As such, we propose deprecating those two INI settings. | ||
+ | |||
+ | |||
+ | ==== Deprecate the report_memleaks INI directive ==== | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | This INI directive allows to suppress ZendMM memory leaks in debug builds of PHP. | ||
+ | This " | ||
+ | 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 ==== | ||
+ | |||
+ | Author: Tim Düsterhus < | ||
+ | |||
+ | 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. | ||
+ | |||
+ | ==== Deprecate building ext/ldap against Oracle LDAP ==== | ||
+ | |||
+ | Author: Christoph M. Becker < | ||
+ | |||
+ | Building ext/ldap against Oracle LDAP had been supported, and is theoretically still supported, but is apparently [[https:// | ||
+ | |||
+ | Therefore we supposed to deprecate building ext/ldap against Oracle LDAP. | ||
+ | |||
+ | It should be noted that the ``ldap_connect_wallet()`` function, [[https:// | ||
+ | |||
+ | ==== Deprecate passing null to readdir(), rewinddir(), | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | TODO: This assumes the last open directory stream opened with < | ||
+ | we have deprecated such usages previous (see mysql and pgsql). | ||
+ | |||
+ | |||
+ | ==== Deprecate the $context parameter for finfo_buffer() | ||
+ | |||
+ | Author: Gina Peter Banyard < | ||
+ | |||
+ | This parameter is unused, and the only reason it exists in the first place is because the implementation of it was delegated to a " | ||
+ | |||
+ | As this parameter is not useful for this function it should be deprecated. | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== |
rfc/deprecations_php_8_5.1730065755.txt.gz · Last modified: 2024/10/27 21:49 by girgias