rfc:error_backtraces

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
rfc:error_backtraces [2020/05/29 16:37] – title maxsemrfc:error_backtraces [2022/04/17 18:30] (current) – Move to inactive ilutov
Line 3: Line 3:
   * Date: 2020-05-25   * Date: 2020-05-25
   * Author: Max Semenik, maxsem.wiki@gmail.com   * Author: Max Semenik, maxsem.wiki@gmail.com
-  * Status: Discussion+  * Status: Inactive
   * First Published at: https://wiki.php.net/rfc/error_backtraces   * First Published at: https://wiki.php.net/rfc/error_backtraces
  
Line 43: Line 43:
 </code> </code>
  
-==== Should there be an INI setting? ==== +**Configuration**: while always having backtraces is nice for debugging, some people might not like the performance overhead of generating backtraces or the risk of having to generate a trace after a fatal error. I therefore propose to address this with an INI setting, ''debug_backtraces'' that allows to turn this feature on and off, as well as to limit the number of stack frames outputted
-My current work-in-progress implementation introduces a new INI setting, ''debug_backtraces'' that allows to turn this feature on and off, as well as to limit the number of stack frames outputted. Zero would mean no backtraces, a positive value means output this number of framesnegative value for no limitBy default it would be on in development settings but off in production. People who don't want to have the overhead of generating backtraces in production or who are afraid for stability can disable this functionality. +  * 0 - no backtraces 
- +  * positive number - output this number of frames 
-This, however, is something I'd like to discuss before going to voting. Heck, traces are always generated for exceptions and nobody moans it's slow.+  * negative value no limit 
 +By default it would be on in development settings but off in production.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
-Everything will behave exactly as before with backtraces disabled, while turning them on would introduce a few minor changes to how errors are represented. Should not be a problem. In the current proposed implementation, a new error flag ''E_UNHANDLED_EXCEPTION'' is introduced, though it's not included in ''E_ALL'' and is transparent for userspace.+  * In the current proposed implementation, a new error flag ''E_UNHANDLED_EXCEPTION'' is introduced to [[https://github.com/php/php-src/pull/5642/files#diff-1a9cfc6173e3a434387996e46086da56R1310|avoid outputting backtraces for unhandled exceptions twice]], though it's not included in ''E_ALL'' and is invisible for userspace
 +  * From the userspace POV, everything will behave exactly as before with backtraces disabled, while turning them on would introduce a few minor changes to how errors are represented.
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 73: Line 75:
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-  * WIP patch:+  * WIP patch: https://github.com/php/php-src/pull/5642
  
 ===== References ===== ===== References =====
rfc/error_backtraces.1590770261.txt.gz · Last modified: 2020/05/29 16:37 by maxsem