rfc:immutability

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:immutability [2017/09/22 13:28] – external edit 127.0.0.1rfc:immutability [2018/02/18 23:33] marijic.silvio
Line 1: Line 1:
 ====== PHP RFC: Immutable classes and properties ====== ====== PHP RFC: Immutable classes and properties ======
-  * Version: 0.1 +  * Version: 0.2 
-  * Date: 2016-08-12+  * Date: 2018-02-19
   * Author: Michal Brzuchalski <michal@brzuchalski.com>   * Author: Michal Brzuchalski <michal@brzuchalski.com>
   * Author: Silvio Marijic <marijic.silvio@gmail.com>   * Author: Silvio Marijic <marijic.silvio@gmail.com>
Line 95: Line 95:
  
 $file = new File(fopen('file.txt')); $file = new File(fopen('file.txt'));
 +</code>
 +
 +Arrays are not allowed to be assigned to immutable properties..
 +<code php>
 +class A {
 +  public immutable $x;
 +
 +  public function __construct ($x) {
 +    $this->x = $x;
 +  }
 +}
 +
 +$file = new A(['foo']);
 </code> </code>
  
rfc/immutability.txt · Last modified: 2018/02/20 11:19 by marijic.silvio