rfc:error_backtraces
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:error_backtraces [2020/05/26 21:29] – created maxsem | rfc:error_backtraces [2020/06/01 21:46] – maxsem | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: Your Title Here ====== | + | ====== PHP RFC: Error backtraces |
* Version: 1.0 | * Version: 1.0 | ||
* Date: 2020-05-25 | * Date: 2020-05-25 | ||
* Author: Max Semenik, maxsem.wiki@gmail.com | * Author: Max Semenik, maxsem.wiki@gmail.com | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
Line 9: | Line 9: | ||
PHP errors, unlike exceptions, are much more limited in programmers' | PHP errors, unlike exceptions, are much more limited in programmers' | ||
- | While it's possible to somewhat address this with '' | + | This problem is so serious that, for example, Wikimedia has created [[https:// |
===== Proposal ===== | ===== Proposal ===== | ||
- | Introduce a new INI setting, '' | + | Add backtraces |
- | **Error output**: traces will be formatted exactly like for exceptions, e.g.: | + | **Error output**: traces will be formatted exactly like for exceptions, and appended to error messages, e.g.: |
< | < | ||
Fatal error: Allowed memory size of 134217728 bytes exhausted in / | Fatal error: Allowed memory size of 134217728 bytes exhausted in / | ||
Line 22: | Line 22: | ||
#3 {main} | #3 {main} | ||
</ | </ | ||
+ | |||
+ | **Logging**: | ||
+ | |||
+ | **'' | ||
+ | < | ||
+ | #1 {main} | ||
+ | array(5) { | ||
+ | [" | ||
+ | int(1) | ||
+ | [" | ||
+ | string(22) " | ||
+ | [" | ||
+ | string(17) "/ | ||
+ | [" | ||
+ | int(3) | ||
+ | [" | ||
+ | string(123) "#0 / | ||
+ | #1 {main}" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **Configuration**: | ||
+ | * 0 - no backtraces | ||
+ | * positive number - output this number of frames | ||
+ | * negative value - no limit | ||
+ | By default it would be on in development settings but off in production. | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
- | Everything | + | * In the current proposed implementation, |
+ | * From the userspace POV, everything | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
8.0 | 8.0 | ||
- | ==== php.ini Defaults ==== | + | ===== php.ini Defaults |
For '' | For '' | ||
* Default value: 0 | * Default value: 0 | ||
Line 39: | Line 66: | ||
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
- | Everything other the minor stuff mentioned in //Backward Incompatible Changes//. | + | Everything other than the minor stuff mentioned in //Backward Incompatible Changes//. |
===== Future Scope ===== | ===== Future Scope ===== | ||
Line 45: | Line 72: | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
- | Accept this RFC (yes/no)? | + | * Accept this RFC (yes/no)? |
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
- | * WIP patch: | + | * WIP patch: |
===== References ===== | ===== References ===== |
rfc/error_backtraces.txt · Last modified: 2022/04/17 18:30 by ilutov