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 revision
Previous revision
Last revisionBoth sides next revision
rfc:notice-for-non-valid-array-container [2016/08/24 15:48] bp1222rfc:notice-for-non-valid-array-container [2017/09/22 13:28] – external edit 127.0.0.1
Line 3: Line 3:
   * Date: 2016-08-16   * Date: 2016-08-16
   * Author: David Walker (dave@mudsite.com)   * Author: David Walker (dave@mudsite.com)
-  * Status: Voting+  * Status: Accepted (Needs finalized PR)
   * First Published at: http://wiki.php.net/rfc/notice-for-non-valid-array-container   * First Published at: http://wiki.php.net/rfc/notice-for-non-valid-array-container
  
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.
 +                             // Output:
 +                             // int(0)
 </file> </file>
  
Line 106: Line 116:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
 Requires 2/3 Vote Requires 2/3 Vote
-<doodle title="E_WARNING for invalid container read array-access" auth="bp1222" voteType="single" closed="false">+<doodle title="E_WARNING for invalid container read array-access" auth="bp1222" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
rfc/notice-for-non-valid-array-container.txt · Last modified: 2019/07/10 12:20 by nikic