rfc:deprecations_php_7_3

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
rfc:deprecations_php_7_3 [2018/06/26 20:21]
kalle Added FILTER_SANITIZE_MAGIC_QUOTES and cleaned up the pdo_odbc.db2_instance_name section
rfc:deprecations_php_7_3 [2018/07/21 21:50] (current)
nikic Implemented
Line 2: Line 2:
   * Date: 2017-08-02   * Date: 2017-08-02
   * Author: Nikita Popov <​nikic@php.net>​   * Author: Nikita Popov <​nikic@php.net>​
-  * Status: ​Under Discussion+  * Status: ​Implemented (in PHP 7.3) 
 +  * Implementation:​ https://​github.com/​php/​php-src/​pull/​3366 (unless other patch linked below) 
 +  * Discussion: https://​externals.io/​message/​102394
  
 ===== Introduction ===== ===== Introduction =====
Line 14: Line 16:
   * ''​fgetss()''​ function and ''​string.strip_tags''​ filter   * ''​fgetss()''​ function and ''​string.strip_tags''​ filter
   * Defining a free-standing ''​assert()''​ function   * Defining a free-standing ''​assert()''​ function
-  * ''​FILTER_FLAG_SCHEME_REQUIRED''​ and ''​FILTER_FLAG_HOST_REQUIRED''​ +  * ''​FILTER_FLAG_SCHEME_REQUIRED''​ and ''​FILTER_FLAG_HOST_REQUIRED'' ​flags
-  * ''​FILTER_SANITIZE_MAGIC_QUOTES''​+
   * ''​pdo_odbc.db2_instance_name''​ php.ini directive   * ''​pdo_odbc.db2_instance_name''​ php.ini directive
  
 ===== Proposal ===== ===== Proposal =====
  
-Each feature proposed for deprecation is voted separately. Each vote requires a 2/3 majority, independently of whether it is a language or standard library change. All votes refer to deprecation in PHP 7.3 and removal in the next major version (presumably PHP 8.0).+Each feature proposed for deprecation is voted separately. Each vote requires a 2/3 majority, independently of whether it is a language or standard library change. All votes refer to deprecation in PHP 7.3 and removal in the next major version (presumably PHP 8.0). The votes close on 2018-07-16.
  
 ==== Undocumented mbstring function aliases ==== ==== Undocumented mbstring function aliases ====
Line 27: Line 28:
  
 Proposed action: Mark the functions as deprecated, so that a deprecation notice is emitted on every call. In PHP 8 these aliases will be removed. Proposed action: Mark the functions as deprecated, so that a deprecation notice is emitted on every call. In PHP 8 these aliases will be removed.
 +
 +<doodle title="​Deprecate (and subsequently remove) undocumented mbstring function aliases?"​ auth="​nikic"​ voteType="​single"​ closed="​true">​
 +   * Yes
 +   * No
 +</​doodle>​
  
 ==== String search functions with integer needle ==== ==== String search functions with integer needle ====
Line 43: Line 49:
  
 Proposed action: Throw a deprecation warning if a non-string is passed as a needle to ''​strpos''​ or one of the above-listed functions. The deprecation warning should note that an explicit ''​chr''​ call may be used instead. In PHP 8 the deprecation warning will be removed and the needle parameter will be changed into a string. Proposed action: Throw a deprecation warning if a non-string is passed as a needle to ''​strpos''​ or one of the above-listed functions. The deprecation warning should note that an explicit ''​chr''​ call may be used instead. In PHP 8 the deprecation warning will be removed and the needle parameter will be changed into a string.
 +
 +<doodle title="​Deprecate (and subsequently remove) integer needles in string search functions?"​ auth="​nikic"​ voteType="​single"​ closed="​true">​
 +   * Yes
 +   * No
 +</​doodle>​
  
 ==== fgetss() function and string.strip_tags filter ==== ==== fgetss() function and string.strip_tags filter ====
Line 48: Line 59:
 The ''​fgetss()''​ function and the ''​string.strip_tags''​ stream filters expose the functionality of ''​strip_tags()''​ in a streaming matter. The need to support these makes the implementation of ''​strip_tags()''​ more complicated,​ as a streaming state machine is necessary. On the other hand, these functions seem to be of very little utility. ''​strip_tags()''​ itself, due to its limitations and known bugs, already has very few legitimate applications. There is no need to provide native support for streaming application on top of that. The ''​fgetss()''​ function and the ''​string.strip_tags''​ stream filters expose the functionality of ''​strip_tags()''​ in a streaming matter. The need to support these makes the implementation of ''​strip_tags()''​ more complicated,​ as a streaming state machine is necessary. On the other hand, these functions seem to be of very little utility. ''​strip_tags()''​ itself, due to its limitations and known bugs, already has very few legitimate applications. There is no need to provide native support for streaming application on top of that.
  
-Proposed action: Mark ''​fgetss()''​ and ''​SplFileObject::​fgetss()''​ as deprecated, so that a deprecation notice is emitted on every call. Generate a deprecation notice if the ''​string.strip_tags''​ stream filter is created. In PHP 8 the functions and the stream filter are removed.+Proposed action: Mark ''​fgetss()'',​ ''​gzgetss()''​ and ''​SplFileObject::​fgetss()''​ as deprecated, so that a deprecation notice is emitted on every call. Generate a deprecation notice if the ''​string.strip_tags''​ stream filter is created. In PHP 8 the functions and the stream filter are removed. 
 + 
 +<doodle title="​Deprecate (and subsequently remove) fgetss() (and variations) and the string.strip_tags filter?"​ auth="​nikic"​ voteType="​single"​ closed="​true">​ 
 +   * Yes 
 +   * No 
 +</​doodle>​
  
 ==== Defining a free-standing assert() function ==== ==== Defining a free-standing assert() function ====
Line 57: Line 73:
  
 Proposed action: Generate a compile-time deprecation warning if an ''​assert()''​ function is declared. In PHP 8 this becomes a compile-error. Proposed action: Generate a compile-time deprecation warning if an ''​assert()''​ function is declared. In PHP 8 this becomes a compile-error.
 +
 +<doodle title="​Deprecate (and subsequently remove) support for defining a free-standing assert() function?"​ auth="​nikic"​ voteType="​single"​ closed="​true">​
 +   * Yes
 +   * No
 +</​doodle>​
  
 ==== FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED ==== ==== FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED ====
Line 66: Line 87:
 Implementation:​ https://​github.com/​php/​php-src/​pull/​3322 Implementation:​ https://​github.com/​php/​php-src/​pull/​3322
  
-==== FILTER_SANITIZE_MAGIC_QUOTES ==== +<doodle title="​Deprecate (and subsequently remove) FILTER_FLAG_(SCHEME|HOST)_REQUIRED flags?"​ auth="​nikic"​ voteType="​single"​ closed="​true">​ 
- +   * Yes 
-Magic quotes were deprecated all the way back in PHP 5.3.0 and later removed in PHP 5.4.0, however the FILTER_SANITIZE_MAGIC_QUOTES were never deprecated. This filter basically mimics calling addslashes() to the input in question. +   * No 
- +</doodle>
-Proposed action: Add a deprecation notice for each time the FILTER_SANITIZE_MAGIC_QUOTES is used. +
- +
-Implementation:​ https://​gist.github.com/​KalleZ/c38cc6ff421d1e565dcbd13166db8693+
  
 ==== pdo_odbc.db2_instance_name php.ini directive ==== ==== pdo_odbc.db2_instance_name php.ini directive ====
  
-As of PHP 5.1.1 ''​pdo_odbc.db2_instance_name''​ was marked as deprecated in the manual, ​leaning towards the removal in a future version of PHP. This ini directive modifies the DB2INSTANCE environment variable for non Windows ​based operating systems, allowing pdo_odbc to make cataloged connections to a DB2 database.+As of PHP 5.1.1 ''​pdo_odbc.db2_instance_name''​ was marked as deprecated in the manual, ​promising ​removal in a future version of PHP. This ini directive modifies the DB2INSTANCE environment variable for non Windows operating systems, allowing pdo_odbc to make cataloged connections to a DB2 database.
  
-The side effect here is that this setting is per process wide and also affects the ODBC extension, which can create some hard to debug siturations. Besides this, the PECL package, ibm_db2 seems to implement the exact same behavior which could also conflict.+The side effect here is that this setting is process wide and also affects the ODBC extension, which can create some hard to debug situations. Besides this, the PECL package, ibm_db2 seems to implement the exact same behavior which could also conflict.
  
 Proposed action: Add a deprecation notice if the ini directive has a value at module initialization. Proposed action: Add a deprecation notice if the ini directive has a value at module initialization.
  
 Implementations:​ https://​gist.github.com/​KalleZ/​424ea78492cd5f4c2198cba6b25403d9 Implementations:​ https://​gist.github.com/​KalleZ/​424ea78492cd5f4c2198cba6b25403d9
 +
 +<doodle title="​Deprecate (and subsequently remove) pdo_odbc.db2_instance_name php.ini directive?"​ auth="​nikic"​ voteType="​single"​ closed="​true">​
 +   * Yes
 +   * No
 +</​doodle>​
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 88: Line 111:
 For PHP 7.3 additional deprecation notices will appear. For PHP 8.0 the previously deprecated functionality will no longer be available. For PHP 7.3 additional deprecation notices will appear. For PHP 8.0 the previously deprecated functionality will no longer be available.
  
-===== Vote =====+===== Proposed Voting Choices ​=====
  
 Each of the bullet points above will get a separate vote. All votes will require a 2/3 supermajority,​ independently of whether they are language changes or not. Each of the bullet points above will get a separate vote. All votes will require a 2/3 supermajority,​ independently of whether they are language changes or not.
rfc/deprecations_php_7_3.1530044502.txt.gz · Last modified: 2018/06/26 20:21 by kalle