PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC by jrfnl · Pull Request #847 · PHPCompatibility/PHPCompatibility
jrfnl
mentioned this pull request
40 tasks
…ions > PHP's infamous `magic_quotes` configuration was removed in PHP 5.4 and the function implementations of checking whether or not these settings have been enabled have returned `false` since then. With PHP 7.0 not having `magic_quotes` at all, it is time to deprecate these functions and remove them entirely. > > Proposal: Mark `get_magic_quotes_gpc()` and `get_magic_quotes_runtime()` as deprecated. This should only impact legacy code bases prior to PHP 5.4, running non-supported versions of PHP. These functions are expected to be removed in PHP 8.0. Refs: * https://wiki.php.net/rfc/deprecations_php_7_4#magic_quotes_legacy * php/php-src#4390 * php/php-src@b2ea507
> The `hebrevc()` function is equivalent to calling `nl2br()` on the result of `hebrev()`, which is a function to convert Hebrew text from logical to visual ordering. While `nl2br(hebrev($str))` is already preferable over `hebrevc($str)` for readability reasons, use of visual ordering is only relevant in contexts that do not have proper Unicode bidi support, such as certain terminals. As detailed in W3C Visual vs. logical ordering of text, visual ordering should never be used for HTML. The `hebrevc()` function is an explicit violation of this principle. > > Proposal: Mark `hebrevc()` as deprecated. This function is expected to be removed in PHP 8.0. Refs: * https://wiki.php.net/rfc/deprecations_php_7_4#hebrevc_function * php/php-src#4390 * php/php-src@4e4d8a4 **Note**: While `nl2br(hebrev($str))` is equivalent, as visual ordering shouldn't be used in HTML and `nl2br()` is only useful in HTML contexts, this equivalent has _not_ been marked as a valid alternative.
> The `convert_cyr_string()` function allows conversion between Cyrillic character sets. The character sets are specified using obscure single character names, such as `convert_cyr_string($str, 'k', 'i')`. This is a legacy function from a time where PHP did not provide general functions for conversion between character sets. Nowadays one of `mb_convert_encoding()`, `iconv()` or `UConverter` may be used for this purpose. > > Proposal: Mark `convert_cyr_string()` as deprecated. This function is expected to be removed in PHP 8.0. Refs: * https://wiki.php.net/rfc/deprecations_php_7_4#convert_cyr_string * php/php-src#4390 * php/php-src@b3668aa
> The `money_format()` function formats currency values using locale-specific settings. It is based on the `strfmon()` C function, which is not supported on all platforms. Most notably it is not available on Windows. Nowadays the `NumberFormatter::formatCurrency()` method provided by `intl` should be used instead, which is both platform-independent and does not rely on the system locale. Additionally, `intl` also provides the ability to parse currency values using `NumberFormatter::parseCurrency()`. > > Furthermore, the `strfmon()` implementation seems to have an internal buffer overrun on macos, which indicates that this functionality is not well tested. This function is expected to be removed in PHP 8.0. Refs: * https://wiki.php.net/rfc/deprecations_php_7_4#money_format * php/php-src#4390 * php/php-src@b1cdf06
> The `ezmlm_hash()` function creates hashes of email addresses which the EZMLM/QMail mailing list system understands. This function is of very limited usefulness for the average PHP developer as the EZMLM/QMail system is barely maintained and its last release was in 2007. The function was most likely originally added for use in the php.net mailing list infrastructure. It can be trivially reimplemented in userland code if needed. > > Proposal: Mark `ezmlm_hash()` as deprecated. This function is expected to be removed in PHP 8.0. Refs: * https://wiki.php.net/rfc/deprecations_php_7_4#ezmlm_hash * php/php-src#4390 * php/php-src@e9e2fa4
> This function is essentially an “alias” of doing `ini_restore('include_path')`. Unlike other functions like `restore_error_handler()` or `restore_exception_handler()`, this function does not operate on a stack and always resets to the original/initial value. While you can use `set_error_handler()` and `restore_error_handler()` as a pair, doing the same with `set_include_path() and `restore_include_path()` is not safe. As such, this function does not offer any benefit over `ini_restore('include_path')` and just causes wrong expectations.
>
> Proposal: Mark `restore_include_path()` as deprecated.
This function is expected to be removed in PHP 8.0.
Refs:
* https://wiki.php.net/rfc/deprecations_php_7_4#restore_include_path_function
* php/php-src#4390
* php/php-src@964de03
wimg approved these changes Aug 26, 2019
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