Skip to content

Instantly share code, notes, and snippets.

@jesseobrien
Last active January 3, 2016 12:28
Show Gist options
  • Select an option

  • Save jesseobrien/8462572 to your computer and use it in GitHub Desktop.

Select an option

Save jesseobrien/8462572 to your computer and use it in GitHub Desktop.
Debug halp file
<?php
class Debug {
/**
* Return the file and line called.
*/
public static function whoCalledMe()
{
$backtrace = debug_backtrace();
$caller = array_shift($backtrace);
Log::alert("Called by :".$caller['file']." on line ".$caller['line']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment