rfc:mixed-typehint

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
rfc:mixed-typehint [2019/02/07 23:48] – improved version with better language and variance rules majklrfc:mixed-typehint [2020/07/22 09:03] (current) kocsismate
Line 1: Line 1:
-====== PHP RFC: Mixed typehint ======+====== PHP RFC: Mixed typehint (obsolete) ======
   * Version: 1.2   * Version: 1.2
   * Date: 2017-07-19   * Date: 2017-07-19
   * Revived: 2019-02-07   * Revived: 2019-02-07
   * Author: Michael Moravec (php.net@majkl578.cz)   * Author: Michael Moravec (php.net@majkl578.cz)
-  * Status: In Draft+  * Status: Obsolete
   * First Published at: http://wiki.php.net/rfc/mixed-typehint   * First Published at: http://wiki.php.net/rfc/mixed-typehint
 +  * Superseded by: [[rfc:mixed_type_v2|https://wiki.php.net/rfc/mixed_type_v2]]
  
 ===== Introduction ===== ===== Introduction =====
Line 22: Line 23:
   - the value is of specific type, but the native type was forgotten.   - the value is of specific type, but the native type was forgotten.
  
-At the time of writing it is not possible between the abovementioned scenarios.+At the time of writing it is not possible to differentiate between the abovementioned scenarios.
  
 Additionally, as values of mixed type cannot be typehinted upon, it is not possible to achieve full native type coverage. Additionally, as values of mixed type cannot be typehinted upon, it is not possible to achieve full native type coverage.
- 
-The behaviour of the ''mixed'' type fully matches the behaviour when nothing is specified for parameter or return type (thus being implicitly mixed), effectively being an alias for previous behaviour. 
  
 ===== Mixed and Void ===== ===== Mixed and Void =====
Line 38: Line 37:
 Due to this difference, ''void'' is not a subtype of ''mixed''. Due to this difference, ''void'' is not a subtype of ''mixed''.
  
-===== Type system hiearchy =====+===== Type system hierarchy =====
  
 <code> <code>
rfc/mixed-typehint.1549583328.txt.gz · Last modified: 2019/02/07 23:48 by majkl