function _drupal_get_last_caller

cis7 _drupal_get_last_caller($backtrace)
cle7 _drupal_get_last_caller($backtrace)
elmsmedia7 _drupal_get_last_caller($backtrace)
icor7 _drupal_get_last_caller($backtrace)
meedjum_blog7 _drupal_get_last_caller($backtrace)
mooc7 _drupal_get_last_caller($backtrace)

Gets the last caller from a backtrace.


$backtrace: A standard PHP backtrace.

Return value

An associative array with keys 'file', 'line' and 'function'.

6 calls to _drupal_get_last_caller()
backtrace_error_handler in sites/all/modules/ulmus/devel/devel.module
Displays backtrace showing the route of calls to the current error.
DrupalTestCase::errorHandler in modules/simpletest/drupal_web_test_case.php
Handle errors during test runs.
DrupalTestCase::exceptionHandler in modules/simpletest/drupal_web_test_case.php
Handle exceptions.
DrupalTestCase::getAssertionCall in modules/simpletest/drupal_web_test_case.php
Cycles through backtrace until the first non-assertion method is found.
_drupal_decode_exception in includes/
Decodes an exception and retrieves the correct caller.

... See full list


includes/, line 260
Functions for error handling.


function _drupal_get_last_caller($backtrace) {
  // Errors that occur inside PHP internal functions do not generate
  // information about file and line. Ignore black listed functions.
  $blacklist = array('debug', '_drupal_error_handler', '_drupal_exception_handler');
  while (($backtrace && !isset($backtrace[0]['line'])) || (isset($backtrace[1]['function']) && in_array($backtrace[1]['function'], $blacklist))) {

  // The first trace is the call itself.
  // It gives us the line and the file of the last call.
  $call = $backtrace[0];

  // The second call give us the function where the call originated.
  if (isset($backtrace[1])) {
    if (isset($backtrace[1]['class'])) {
      $call['function'] = $backtrace[1]['class'] . $backtrace[1]['type'] . $backtrace[1]['function'] . '()';
    else {
      $call['function'] = $backtrace[1]['function'] . '()';
  else {
    $call['function'] = 'main()';
  return $call;