rfc:notice-for-non-valid-array-container

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:notice-for-non-valid-array-container [2016/08/24 15:48] bp1222rfc:notice-for-non-valid-array-container [2016/08/31 18:09] bp1222
Line 27: Line 27:
                      // Output would be:                      // Output would be:
                      // Warning: Variable of type integer does not accept array offsets                      // Warning: Variable of type integer does not accept array offsets
 +                     
 +// Brought up during vote:
 +$a = [null];
 +$c = null;
 +var_dump($a[0][0] + $c[0]);  // This will through 2 E_WARNINGS, First would be $a[0][0]
 +                             // For the same reason as above, $a[0] is rightfully NULL
 +                             // and accessing [0] on null is invalid.  The second, 
 +                             // would be $c[0] for the same reason.
 </file> </file>
  
rfc/notice-for-non-valid-array-container.txt · Last modified: 2019/07/10 12:20 by nikic