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 revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:deprecations_php_7_3 [2018/06/26 17:21] – Add hebrevc() function nikicrfc:deprecations_php_7_3 [2018/07/05 20:11] – Add implementation link nikic
Line 3: Line 3:
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
   * Status: Under Discussion   * Status: Under Discussion
 +  * Implementation: https://github.com/php/php-src/pull/3366 (unless other patch linked below)
  
 ===== Introduction ===== ===== Introduction =====
Line 14: Line 15:
   * ''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 
-  * ''hebrevc()'' function+  * ''FILTER_SANITIZE_MAGIC_QUOTES'' filter 
 +  * ''pdo_odbc.db2_instance_name'' php.ini directive
  
 ===== Proposal ===== ===== Proposal =====
Line 47: Line 49:
 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.
  
 ==== Defining a free-standing assert() function ==== ==== Defining a free-standing assert() function ====
Line 65: Line 67:
 Implementation: https://github.com/php/php-src/pull/3322 Implementation: https://github.com/php/php-src/pull/3322
  
-==== hebrevc() function ====+==== FILTER_SANITIZE_MAGIC_QUOTES ====
  
-The ''hebrevc($str)'' function is equivalent to ''nl2br(hebrev($str))''. This is a case where the explicit version is much clearer than the shortcut. Combined with the fact that ''hebrevc()'' is a rather niche function, a deprecation is suggested.+Magic quotes were deprecated all the way back in PHP 5.3 and later removed in PHP 5.4, however FILTER_SANITIZE_MAGIC_QUOTES was never deprecated. This filter basically mimics calling addslashes() on the input in question.
  
-Proposed action: Mark ''hebrevc()'' as deprecated, so that deprecation warning is thrown on each callIn PHP 8 the function will be removed.+Proposed action: Emit a deprecation notice each time the FILTER_SANITIZE_MAGIC_QUOTES filter is used. 
 + 
 +==== 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 manualpromising removal in 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 process wide and also affects the ODBC extension, which can create some hard to debug situationsBesides 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. 
 + 
 +Implementations: https://gist.github.com/KalleZ/424ea78492cd5f4c2198cba6b25403d9
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/deprecations_php_7_3.txt · Last modified: 2018/07/21 21:50 by nikic