PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC#847
Merged
PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC#847
Conversation
40 tasks
2e46b49 to
984490d
Compare
As of PHP 7.4, the `is_real()` function is deprecated. Use `is_float()` instead. This function is expected to be removed in PHP 8.0. Refs: * https://wiki.php.net/rfc/deprecations_php_7_4#the_real_type * php/php-src#4390 * php/php-src@4e19069
…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
984490d to
f5612fb
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to #808
PHP 7.4/RemovedFunctions: handle deprecated is_real()
As of PHP 7.4, the
is_real()function is deprecated. Useis_float()instead.This function is expected to be removed in PHP 8.0.
Refs:
PHP 7.4/RemovedFunctions: handle deprecated magic quote related functions
These functions are expected to be removed in PHP 8.0.
Refs:
PHP 7.4/RemovedFunctions: handle deprecated hebrevc()
This function is expected to be removed in PHP 8.0.
Refs:
Note: While
nl2br(hebrev($str))is equivalent, as visual ordering shouldn't be used in HTML andnl2br()is only useful in HTML contexts, this equivalent has not been marked as a valid alternative.PHP 7.4/RemovedFunctions: handle deprecated convert_cyr_string()
This function is expected to be removed in PHP 8.0.
Refs:
PHP 7.4/RemovedFunctions: handle deprecated money_format()
This function is expected to be removed in PHP 8.0.
Refs:
PHP 7.4/RemovedFunctions: handle deprecated ezmlm_hash()
This function is expected to be removed in PHP 8.0.
Refs:
PHP 7.4/RemovedFunctions: handle deprecated restore_include_path()
This function is expected to be removed in PHP 8.0.
Refs: