rfc:deprecations_php_7_4

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_4 [2019/02/11 15:52]
nikic
rfc:deprecations_php_7_4 [2019/06/17 05:11] (current)
kalle
Line 24: Line 24:
   * ''​get_called_class()''​ function   * ''​get_called_class()''​ function
   * ''​is_writeable()''​ function alias   * ''​is_writeable()''​ function alias
 +  * ''​implode()''​ parameter order mix
 +  * ''​convert_cyr_string()''​ function
 +  * ''​money_format()''​ function
 +  * ''​ezmlm_hash()''​ function
 +  * ''​allow_url_include''​ ini directive
  
 The following are still Work-In-Progress and ideas: The following are still Work-In-Progress and ideas:
  
   * Second parameter of spl_autoload() and its associated function spl_autoload_extensions()   * Second parameter of spl_autoload() and its associated function spl_autoload_extensions()
-  * convert_cyr_string() 
-  * allow_url_include ini directive 
-  * Unify parameter order for implode() to match explode() 
   * Function variants that already exists as constants (e.g. php_sapi_name(),​ phpversion(),​ pi())   * Function variants that already exists as constants (e.g. php_sapi_name(),​ phpversion(),​ pi())
-  * money_format() 
-  * ezmlm_hash() 
  
 ===== Proposal ===== ===== Proposal =====
Line 170: Line 170:
 The ''​is_writeable()''​ function is an alias of ''​is_writable()''​. ''​is_writeable()''​ is notorious in the sense that it has a spelling mistake in its name and since the introduction of ''​is_writable()''​ been considered soft deprecated. The ''​is_writeable()''​ function is an alias of ''​is_writable()''​. ''​is_writeable()''​ is notorious in the sense that it has a spelling mistake in its name and since the introduction of ''​is_writable()''​ been considered soft deprecated.
  
-Proposal: Deprecate alias+Proposal: Deprecate ​the alias 
 + 
 +==== implode() parameter order mix ==== 
 + 
 +The ''​implode()''​ function historically supports passing the ''​$glue''​ and ''​$pieces''​ parameters in any order, for consistency with ''​explode()'',​ this is inconsistent and the only function in the standard library exhibits this behavior and it should be amended. 
 + 
 +This naturally also affects the ''​implode()''​ alias: ''​join()''​. 
 + 
 +Proposal: Emit a deprecation warning if calling ''​implode($pieces,​ $glue)''​ 
 + 
 +==== convert_cyr_string() ==== 
 + 
 +The ''​convert_cyr_string()''​ function allows conversion between cyrillic character sets. This function is a legacy function back from when PHP didn't provide a lot of utility to convert between character sets. Today we have extensions like ''​mbstring'',​ ''​intl''​ and ''​iconv''​ that allows this kind of conversion in a more general perspective. On top of this, this function also uses non standard naming of character set names. 
 + 
 +Proposal: Deprecate this function 
 + 
 +==== money_format() ==== 
 + 
 +The ''​money_format()''​ function allows currency based on locale specific settings to be presented using the C function ''​strfmon()''​. However some systems do not support this function, notably Windows. Instead the functionality for formatting currency as provided by the ''​intl''​ extension should be used instead ''​NumberFormatter::​formatCurrency()''​. The ''​intl''​ extension also provides even further capabilities to parse currencies using ''​NumberFormatter::​parseCurrency()''​ for any locale support by ICU and not just the system which PHP is installed on. 
 + 
 +Proposal: Deprecate this function 
 + 
 +==== ezmlm_hash() ==== 
 + 
 +The ''​ezmlm_hash()''​ function creates hashes of email addresses which the EZMLM/QMail email mailing list system understands,​ however this function takes any input as long as it is a string and doesn'​t care whether or not this is an email address or not and therefore can create possible hash collisions. 
 + 
 +Besides that, the function is of limited usage for the average PHP developer given the EZMLM/QMail system is barely maintained and its last release was in 2007. The function was most likely added due to the PHP.net infrastructure uses that for the mailing lists, however it can be implemented in userland code with ease for those still supporting this. 
 + 
 +Proposal: Deprecate this function 
 + 
 +==== allow_url_include ==== 
 + 
 +The ''​allow_url_include''​ (disabled by default) ini directive allows the ''​require'',​ ''​require_once'',​ ''​include''​ and ''​include_once''​ language constructs to use url wrappers. To use this ini directive, the ''​allow_url_fopen''​ ini directive must also be enabled. 
 + 
 +Setting this directive to on enables a potential security hazard if the path sent to either of the include constructs are crafted by external data. The ability to include a PHP file from a remote domain is questionable and have a huge potential security risk and therefore should be deprecated from PHP. 
 + 
 +Proposal: Add a deprecation notice if ''​allow_url_include=1''​ on startup 
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/deprecations_php_7_4.1549900366.txt.gz · Last modified: 2019/02/11 15:52 by nikic