rfc:deprecations_php_7_2

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:deprecations_php_7_2 [2016/12/21 16:25] nikicrfc:deprecations_php_7_2 [2017/01/15 14:14] nikic
Line 19: Line 19:
   * ''parse_str()'' without second argument   * ''parse_str()'' without second argument
   * ''gmp_random()''   * ''gmp_random()''
-  * ''(binary)'' cast and ''%%b""%%'' literals 
   * ''each()''   * ''each()''
   * ''assert()'' with string argument   * ''assert()'' with string argument
Line 81: Line 80:
  
 Proposed action: Mark the function as deprecated, thus issuing a deprecation notice on every call. Proposed action: Mark the function as deprecated, thus issuing a deprecation notice on every call.
- 
-==== (binary) cast and b"" literals ==== 
- 
-The binary cast and binary string literals were originally introduced as forward-compatibility features for PHP 6. Currently they behave identically to ordinary (string) casts and ordinary string literals. Given that PHP 6 has been dead for years and it is unlikely that it will be resurrected in the same form, it is time to remove these forward-compatibility tokens. 
- 
-Proposed action: Throw a compile-time deprecation whenever binary casts or binary string literals are used. 
  
 ==== each() ==== ==== each() ====
Line 122: Line 115:
  
 Proposed action: Throw deprecation notice if error handler has five or more arguments. Otherwise, do not pass the ''$errcontext''. This prevents circumvention with ''func_get_args()''. Proposed action: Throw deprecation notice if error handler has five or more arguments. Otherwise, do not pass the ''$errcontext''. This prevents circumvention with ''func_get_args()''.
 +
 +==== (binary) cast and b"" literals ====
 +
 +This deprecation has been extracted into a separate RFC: [[rfc/binary_string_deprecation|Binary String Deprecation RFC]]
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 161: Line 158:
  
 The motivations for removing this functionality are similar to those of ''$php_errormsg'', so it would seem reasonable to deprecate them at the same time. However, unlike ''$php_errormsg'' there exist no //simple// alternatives to ''$http_response_header''. The [[http://php.net/get_headers|get_headers]] function returns only the headers, but not the response body. Getting both requires, to my knowledge, a combination of ''fopen()'', ''stream_get_contents()'' and reading the ''wrapper_data'' from ''stream_get_meta_data()''. The motivations for removing this functionality are similar to those of ''$php_errormsg'', so it would seem reasonable to deprecate them at the same time. However, unlike ''$php_errormsg'' there exist no //simple// alternatives to ''$http_response_header''. The [[http://php.net/get_headers|get_headers]] function returns only the headers, but not the response body. Getting both requires, to my knowledge, a combination of ''fopen()'', ''stream_get_contents()'' and reading the ''wrapper_data'' from ''stream_get_meta_data()''.
- 
-===== Changelog ===== 
- 
-  * 2016-02-19: Added (unset) cast 
-  * 2016-02-19: Added mbstring.func_overload 
-  * 2016-02-18: Added getrandmax() 
rfc/deprecations_php_7_2.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1