Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-08 Thread Patrick ALLAERT
2011/4/8 Sebastian Bergmann : > Am 04.04.2011 17:22, schrieb Sebastian Bergmann: >> Any thoughts? > >  Are there any objections to applying the latest version of the patch [1] >  to trunk? I still think that debug_backtrace and debug_print_backtrace >  are in need of refactoring but that should be

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-08 Thread Sebastian Bergmann
Am 04.04.2011 17:22, schrieb Sebastian Bergmann: > Any thoughts? Are there any objections to applying the latest version of the patch [1] to trunk? I still think that debug_backtrace and debug_print_backtrace are in need of refactoring but that should be kept separate, I think. -- [1] https:

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-06 Thread Sebastian Bergmann
On 04/05/2011 03:56 AM, Ben Schmidt wrote: Good idea. Have you considered how Xdebug does this kind of thing (through configuration directives, IIRC--I know it uses such things for var_dump) and whether that might suggest a better or more future-proof approach? I do not want to add any INI dir

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Sebastian Bergmann
On 04/05/2011 03:23 PM, Patrick ALLAERT wrote: Both debug_backtrace() and debug_print_backtrace() uses arginfo_debug_backtrace Had not noticed that "optimization", thanks. Patch updated. -- Sebastian BergmannCo-Founder and Principal Consultant http://sebastian-bergmann.de/

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Patrick ALLAERT
2011/4/5 Sebastian Bergmann : > On 04/05/2011 01:12 PM, Patrick ALLAERT wrote: >> >> I would, however, refrain from providing erroneous reflection information: >> >> php --rf debug_print_backtrace >> Function [  function debug_print_backtrace ] { >> >>   - Parameters [2] { >>     Parameter #0 [  $o

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Christer Edvartsen
From the ChangeLog: 2004-04-13 Zeev Suraski * zend_builtin_functions.c: Fix debug_backtrace to show arguments again We need to merge code from debug_backtrace & debug_print_backtrace at some point! About time! ;) On 04/05/2011 01:57 PM, Sebastian Bergmann wrote: On 04/

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Sebastian Bergmann
On 04/05/2011 01:12 PM, Patrick ALLAERT wrote: I would, however, refrain from providing erroneous reflection information: php --rf debug_print_backtrace Function [ function debug_print_backtrace ] { - Parameters [2] { Parameter #0 [ $options ] Parameter #1 [ $limit ] } } I

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Patrick ALLAERT
2011/4/5 Sebastian Bergmann : > On 04/05/2011 12:39 PM, Patrick ALLAERT wrote: >> >> They share nothing in terms of code > >  Question is: should debug_print_backtrace() not be refactored to reuse >  code from zend_fetch_debug_backtrace()? That is why did not touch it >  yet. +1 I greatly share th

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Sebastian Bergmann
On 04/05/2011 12:39 PM, Patrick ALLAERT wrote: They share nothing in terms of code Question is: should debug_print_backtrace() not be refactored to reuse code from zend_fetch_debug_backtrace()? That is why did not touch it yet. -- Sebastian BergmannCo-Founder and Princip

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Patrick ALLAERT
2011/4/5 Sebastian Bergmann : > On 04/04/2011 07:37 PM, Patrick ALLAERT wrote: >> >> I would then add the same option to debug_print_backtrace(). > >  Not sure I want to touch debug_print_backtrace() as it does not use >  zend_fetch_debug_backtrace(). They share nothing in terms of code, but well

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Sebastian Bergmann
On 04/05/2011 11:17 AM, Patrick ALLAERT wrote: Don't also forget to change in the test: [file] => /usr/local/src/php/src/trunk/Zend/tests/debug_backtrace_limit.php to something like: [file] => %s/Zend/tests/debug_backtrace_limit.php Accidentally reverted that, thanks. Fixed again. -- Seb

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-05 Thread Patrick ALLAERT
2011/4/5 Sebastian Bergmann : > On 04/04/2011 07:37 PM, Patrick ALLAERT wrote: >> >> I would then add the same option to debug_print_backtrace(). > >  Not sure I want to touch debug_print_backtrace() as it does not use >  zend_fetch_debug_backtrace(). > >> It could also make sense to test it with a

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-04 Thread Sebastian Bergmann
On 04/04/2011 07:37 PM, Patrick ALLAERT wrote: I would then add the same option to debug_print_backtrace(). Not sure I want to touch debug_print_backtrace() as it does not use zend_fetch_debug_backtrace(). It could also make sense to test it with a limit greater than the actual depth. Th

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-04 Thread Ben Schmidt
Good idea. Have you considered how Xdebug does this kind of thing (through configuration directives, IIRC--I know it uses such things for var_dump) and whether that might suggest a better or more future-proof approach? Ben. On 5/04/11 1:22 AM, Sebastian Bergmann wrote: https://gist.github.c

Re: [PHP-DEV] Optional $limit argument for debug_backtrace()

2011-04-04 Thread Patrick ALLAERT
2011/4/4 Sebastian Bergmann : >  https://gist.github.com/901579 is a patch against trunk that adds an >  optional $limit argument to debug_backtrace() to limit the number of >  frames returned. > >  Any thoughts? I would then add the same option to debug_print_backtrace(). It could also make sens