[PHP-DEV] call_stack

2002-11-27 Thread Miham KEREKES
Hi! I'm new to this list, I want to know if there is any function which could return the actual call stack, or is it planned to be added? It could be very useful (for example in my case, now :-). If it's already implemented, i'm sorry, i could not be able to find it in the doc.. In this case

Re: [PHP-DEV] call_stack

2002-11-27 Thread Derick Rethans
On Wed, 27 Nov 2002, Miham KEREKES wrote: Hi! I'm new to this list, I want to know if there is any function which could return the actual call stack, or is it planned to be added? It could be very useful (for example in my case, now :-). debug_backtrace() will be available in PHP 4.3.0 and

Re: [PHP-DEV] call_stack

2002-11-27 Thread Phil Dier
On Wed, 27 Nov 2002 15:41:25 +0100 (CET) Derick Rethans [EMAIL PROTECTED] wrote: On Wed, 27 Nov 2002, Miham KEREKES wrote: Hi! I'm new to this list, I want to know if there is any function which could return the actual call stack, or is it planned to be added? It could be very

Re: [PHP-DEV] call_stack

2002-11-27 Thread George Schlossnagle
debug_backtrace was backported into ze1. 4.3 will sstill use ze1. George Phil Dier wrote: On Wed, 27 Nov 2002 15:41:25 +0100 (CET) Derick Rethans [EMAIL PROTECTED] wrote: On Wed, 27 Nov 2002, Miham KEREKES wrote: Hi! I'm new to this list, I want to know if there is any function which

Re: [PHP-DEV] call_stack

2002-11-27 Thread Sterling Hughes
On Wed, 27 Nov 2002 15:41:25 +0100 (CET) Derick Rethans [EMAIL PROTECTED] wrote: On Wed, 27 Nov 2002, Miham KEREKES wrote: Hi! I'm new to this list, I want to know if there is any function which could return the actual call stack, or is it planned to be added? It could be

Re: [PHP-DEV] call_stack

2002-11-27 Thread Andi Gutmans
At 03:41 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002, Miham KEREKES wrote: Hi! I'm new to this list, I want to know if there is any function which could return the actual call stack, or is it planned to be added? It could be very useful (for example in my case, now :-).

Re: [PHP-DEV] call_stack

2002-11-27 Thread Andi Gutmans
At 07:23 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002, Andi Gutmans wrote: At 03:41 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002, Miham KEREKES wrote: debug_backtrace() will be available in PHP 4.3.0 and higher. if someone has time to implement

Re: [PHP-DEV] call_stack

2002-11-27 Thread George Schlossnagle
I'll do it, if you want. Andi Gutmans wrote: At 07:23 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002, Andi Gutmans wrote: At 03:41 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002, Miham KEREKES wrote: debug_backtrace() will be available in PHP 4.3.0 and

Re: [PHP-DEV] call_stack

2002-11-27 Thread Andi Gutmans
That'd be cool. At 01:32 PM 11/27/2002 -0500, George Schlossnagle wrote: I'll do it, if you want. Andi Gutmans wrote: At 07:23 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002, Andi Gutmans wrote: At 03:41 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002,

Re: [PHP-DEV] call_stack

2002-11-27 Thread Brad Fisher
Andi Gutmans wrote: At 03:41 PM 11/27/2002 +0100, Derick Rethans wrote: On Wed, 27 Nov 2002, Miham KEREKES wrote: Hi! I'm new to this list, I want to know if there is any function which could return the actual call stack, or is it planned to be added? It could be very useful

Re: [PHP-DEV] call_stack

2002-11-27 Thread Andi Gutmans
I'd probably go for class::function($arg1, $arg2). Also take into consideration that the args aren't always available. Andi At 02:58 PM 11/27/2002 -0500, George Schlossnagle wrote: Is there a concensus on how arguments should be printed out? I'm shooting right now for a 'cluck' style backtrave

Re: [PHP-DEV] call_stack

2002-11-27 Thread Miham KEREKES
Is there a concensus on how arguments should be printed out? I'm shooting right now for a 'cluck' style backtrave class::function() called at file:line Perhaps class::function() called at file:line Arguments: print_r(args) ?? Well, probably the following: class::function()

Re: [PHP-DEV] call_stack

2002-11-27 Thread George Schlossnagle
Hmmm any hints on how to get the variable name out of the stack? The code in debug_backtrace seems to only extract the value. George Andi Gutmans wrote: I'd probably go for class::function($arg1, $arg2). Also take into consideration that the args aren't always available. Andi At 02:58

Re: [PHP-DEV] call_stack

2002-11-27 Thread Andi Gutmans
At 03:13 PM 11/27/2002 -0500, George Schlossnagle wrote: Hmmm any hints on how to get the variable name out of the stack? The code in debug_backtrace seems to only extract the value. There's no way but I don't think it's needed. When I wrote $arg1 I meant the value not the name of the

Re: [PHP-DEV] call_stack

2002-11-27 Thread George Schlossnagle
Ok... but that looks nasty when you are passed an array or an object. Andi Gutmans wrote: At 03:13 PM 11/27/2002 -0500, George Schlossnagle wrote: Hmmm any hints on how to get the variable name out of the stack? The code in debug_backtrace seems to only extract the value. There's no

Re: [PHP-DEV] call_stack

2002-11-27 Thread Andi Gutmans
At 03:18 PM 11/27/2002 -0500, George Schlossnagle wrote: Ok... but that looks nasty when you are passed an array or an object. Yeah but backtraces tend to look nasty :) Andi Andi Gutmans wrote: At 03:13 PM 11/27/2002 -0500, George Schlossnagle wrote: Hmmm any hints on how to get

Re: [PHP-DEV] call_stack

2002-11-27 Thread Sebastian Bergmann
George Schlossnagle wrote: Is there a concensus on how arguments should be printed out? I quite like the output of foreach ($backtrace as $step) { if (!empty($step['args'])) { foreach ($step['args'] as $arg) { $args = isset($args) ? $args . ', ' : '';

Re: [PHP-DEV] call_stack

2002-11-27 Thread George Schlossnagle
Here's first shot at a patch. The output it generates is ugly as sin if you use objects though. I though about flattening them out, but that gets long and nasty (and requires specialized print functions which while easy seem to be of marginal use elsewhere.) George Index:

Re: [PHP-DEV] call_stack

2002-11-27 Thread George Schlossnagle
And here is a version which flattens the calling args onto a single line (similar to sebastians usersapce script). Longer, but a bit prettier output. Index: Zend/zend.c === RCS file: /repository/Zend/zend.c,v retrieving revision