rfc:deprecate-boolean-string-coercion

Differences

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

Link to this comparison view

Next revision
Previous revision
rfc:deprecate-boolean-string-coercion [2021/06/22 22:05] – created girgiasrfc:deprecate-boolean-string-coercion [2021/06/25 13:05] (current) – Fix bullet list girgias
Line 17: Line 17:
  
 Emit an ''%%E_DEPRECATED%%'' deprecation diagnostic for implicit coercion of a boolean to a string. Emit an ''%%E_DEPRECATED%%'' deprecation diagnostic for implicit coercion of a boolean to a string.
 +
 +The diagnostic message is:
 + > Implicit bool to string coercion is deprecated 
  
 Raise this deprecation diagnostic to a TypeError in the next major version (PHP 9.0). Raise this deprecation diagnostic to a TypeError in the next major version (PHP 9.0).
 +
 +Amending the type signature of the following functions as their usage with a boolean argument
 +is common:
 +
 +  * <php>ini_set()</php>
  
 ===== Rationale ===== ===== Rationale =====
Line 31: Line 39:
  
   * Concatenation operator ''%%.%%''   * Concatenation operator ''%%.%%''
 +  * <php>echo</php> language construct
 +  * <php>print</php> language construct
 +  * String interpolation
   * Assignment to a typed property of type ''%%string%%'' in coercive typing mode   * Assignment to a typed property of type ''%%string%%'' in coercive typing mode
   * Argument for a parameter of type ''%%string%%'' for both internal and userland functions in coercive typing mode   * Argument for a parameter of type ''%%string%%'' for both internal and userland functions in coercive typing mode
Line 37: Line 48:
 ===== Proposed PHP Version ===== ===== Proposed PHP Version =====
  
-Deprecation: next minor version, i.e. PHP 8.1.+Deprecation and function signature changes: next minor version, i.e. PHP 8.1.
  
 Promotion to TypeError: next major version, i.e. PHP 9.0. Promotion to TypeError: next major version, i.e. PHP 9.0.
Line 48: Line 59:
   * Coercion from bool to int   * Coercion from bool to int
   * Coercion from bool to float   * Coercion from bool to float
 +  * <php>printf()</php> family of functions
  
 ===== Future scope ===== ===== Future scope =====
rfc/deprecate-boolean-string-coercion.1624399558.txt.gz · Last modified: 2021/06/22 22:05 by girgias