rfc:debug_backtrace_depth

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:debug_backtrace_depth [2021/03/13 18:10] tandrerfc:debug_backtrace_depth [2021/06/02 02:05] (current) tandre
Line 3: Line 3:
   * Date: 2021-03-13   * Date: 2021-03-13
   * Author: Tyson Andre, tandre@php.net   * Author: Tyson Andre, tandre@php.net
-  * Status: Under Discussion+  * Status: Withdrawn
   * First Published at: https://wiki.php.net/rfc/debug_backtrace_depth   * First Published at: https://wiki.php.net/rfc/debug_backtrace_depth
   * Implementation: https://github.com/php/php-src/pull/6653   * Implementation: https://github.com/php/php-src/pull/6653
Line 110: Line 110:
 ===== Proposed PHP Version ===== ===== Proposed PHP Version =====
 8.1 8.1
 +
 +===== Discussion =====
 +
 +==== Limited to a specific use case ====
 +
 +https://externals.io/message/113502#113821
 +
 +<blockquote>
 +There hasn't been much discussion on this one, probably because the
 +functionality and use cases are so specific. I'm not really convinced by
 +your examples.
 +
 +For the purpose of printing debug logs, using an engine-provided depth is
 +non-ideal, because any intermediate helper functions will count towards the
 +depth. Tracking your own depth will result in a more meaningful/predictable
 +output.
 +
 +For tracking down infinite recursion, isn't this what the xdebug recursion
 +limit is for? You'll directly get your recursive stack trace, which should
 +make it obvious where the infinite recursion occurs. Using
 +debug_backtrace_depth() for this purpose means that you actually already
 +need to know where you are infinitely recursing in order to place the guard.
 +
 +If you want to find places where your code would hit the xdebug recursion
 +limit, then why not run it under xdebug and find out, rather than trying to
 +simulate the same behavior manually? That again requires that you actually
 +place relevant guards in the first place, which makes this another chicken
 +and egg problem.
 +</blockquote>
 +
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
  
 Yes/No, requiring a 2/3 majority Yes/No, requiring a 2/3 majority
rfc/debug_backtrace_depth.1615659017.txt.gz · Last modified: 2021/03/13 18:10 by tandre