error_handler : unique "caller ID" ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear list,

a penny for your thoughts on the following problem.

Does anyone have an idea how to find a unique "caller ID" for a user-defined error handler ?

The goal is to get a cached error messages tree where the following snippet would yield an array as below it:

// start-of-snippet

function Outer(&$a)
{
   trigger_error('entering Outer');
   $a=Inner($a) ;
   trigger_error('leaving Outer') ;
}

function Inner($x)
{
   trigger_error('entering Inner');
   return(2*$x) ;
}

trigger_error('Here we go ');
$b = 1 ;
$b = Outer($b) ;
trigger_error('End result is $b');


// end-of-snippet

Output:

Array(
[0] => 'Here we go'
['Outer(<unique_ID_01>)'] => Array(
   [0] => 'entering Outer' ;
   ['Inner(<unique_ID_02>)'] => Array(
      [0] => 'entering Inner' ;
       )
   [1] => 'leaving Outer' ;
   )
[1] => 'End result is 2'
)

I've considered the 'args' option in debug_backtrace(), but that fails for referenced arguments.

Having read access to a variable's address (like a C-pointer) would be perfect - but Google tells me you can't in PHP.

Any other idea's ?

Regards,

Bert

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux