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 14:46] 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 47: Line 57:
  
 Execution Time (DualCore 3ghz; 2g ram) Execution Time (DualCore 3ghz; 2g ram)
-Current Master : ~0.09s +  * Current Master : ~0.09s (~489m operations) 
-Current Master w/RFC Displaying Warnings: ~33.25s +  Current Master w/RFC Displaying Warnings: ~33.25s (~7.799b operations) 
-Current Master w/RFC Hiding Warnings: ~0.82s+  Current Master w/RFC Hiding Warnings: ~0.82s (~4.091b operations) 
 + 
 +We can see there is a significant increase in operations on huge loads.  However, I wouldn't suspect 1m of these errors per request almost ever.  So, yes there is; but I'd call it useful information overhead.
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 104: 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
Line 110: Line 122:
 Vote Start: 2016-08-16 15:36 Vote Start: 2016-08-16 15:36
  
-Vote End:   2016-08-23 23:59+Vote End:   2016-08-31 23:59
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
rfc/notice-for-non-valid-array-container.txt · Last modified: 2019/07/10 12:20 by nikic