rfc:deprecations_php_8_0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
rfc:deprecations_php_8_0 [2020/07/31 21:55]
kocsismate
rfc:deprecations_php_8_0 [2021/01/15 05:22]
girgias Add unserialize_callback_func INI setting to the list
Line 1: Line 1:
 ====== PHP RFC: Deprecations for PHP 8.1 ====== ====== PHP RFC: Deprecations for PHP 8.1 ======
   * Date: 2019-07-23   * Date: 2019-07-23
-  * Author: Nikita Popov <nikic@php.net>, George Peter Banyard <girgias@php.net>+  * Author: Nikita Popov <nikic@php.net>, George Peter Banyard <girgias@php.net>, Máté Kocsis <kocsismate@php.net>
   * Status: Under Discussion   * Status: Under Discussion
  
Line 19: Line 19:
   * Accessing static members on traits   * Accessing static members on traits
   * ''strftime()'' and ''gmtstrftime()''   * ''strftime()'' and ''gmtstrftime()''
-  * The procedural API of ''ext/fileinfo'' 
   * Passing a method name as the first parameter to ''ReflectionMethod'''s constructor   * Passing a method name as the first parameter to ''ReflectionMethod'''s constructor
 +  * ''mhash*()'' function family
 +  * %%''DatePeriod::__construct()''%%
 +  * ''ctype_*()'' function family accepts ''int'' parameters
 +  * Return by reference with void type
 +  * NIL constant defined by the IMAP extension
 +  * ''unserialize_callback_func'' INI setting
  
 ===== Proposal ===== ===== Proposal =====
Line 144: Line 149:
 ==== strftime() and gmstrftime() ==== ==== strftime() and gmstrftime() ====
  
-==== The procedural API of ext/fileinfo ==== +==== strptime() ====
- +
-It uses resources, while there is an OO API available.+
  
 ==== Passing a method name as the first parameter to ReflectionMethod::__construct() ==== ==== Passing a method name as the first parameter to ReflectionMethod::__construct() ====
  
 A ''ReflectionMethod::fromMethodName()'' method should be added as a replacement. A ''ReflectionMethod::fromMethodName()'' method should be added as a replacement.
 +
 +==== mhash*() function family ====
 +
 +''mhash*()'' functions were integrated into ext/hash in PHP 5.3 as a compatibility layer for ext/mhash (which has been removed in PHP 7.0), but they are hardly ever used, and very ill-behaved (primarily ''mhash()'').
 +
 +==== DatePeriod::__construct() ====
 +
 +This is a heavily overloaded function (it has 3 signatures) which should be deprecated in favour of 3 factory methods.
 +
 +==== ctype_*() function family accepts int parameters ====
 +
 +Although the documentation currently lists ''string'' as a valid parameter type for ''ctype_*'' functions, it's not the case. They also accept an integer which is only mentioned in a note:
 +
 +<blockquote>
 +If an integer between -128 and 255 inclusive is provided, it is interpreted as the ASCII value of a single character (negative values have 256 added in order to allow characters in the Extended ASCII range). Any other integer is interpreted as a string containing the decimal digits of the integer.
 +</blockquote>
 +
 +Moreover, if any other type than int or string is passed, ''ctype_*()'' functions silently return ''false''.
 +
 +Since the current behaviour is highly surprising, passing integer values to ''ctype_*()'' functions should be deprecated first, and ZPP should be modified to only accept strings in the next major version.
 +
 +==== Predefined variable $http_response_header ====
 +W.I.P.
 +See https://www.php.net/manual/en/reserved.variables.httpresponseheader.php
 +We already deprecated/removed $php_errormsg and $HTTP_RAW_POST_DATA
 +
 +==== Return by reference with void type ====
 +
 +''function &test(): void {}'' currently allows, probably shouldn't be?
 +
 +
 +==== NIL constant defined by the IMAP extension ====
 +The ''NIL'' constant corresponds to the value ''0'', and can be confused with ''null''.
 +
 +==== unserialize_callback_func INI setting ====
 +W.I.P. (but from my understanding this was used with __autoload() only - girgias)
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/deprecations_php_8_0.txt · Last modified: 2021/02/23 14:37 by nikic