Skip to content

Instantly share code, notes, and snippets.

@sambfreund
sambfreund / Find Function
Created July 7, 2016 15:15
This finds a function's origin. Useful in files with multiple include files. I don't take credit for this, but just don't remember where I found it.
$reflFunc = new ReflectionFunction('FUNCTION NAME');
print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine();
@sambfreund
sambfreund / Globals
Created July 13, 2016 19:58
Display global information - small snippit
echo "<pre>";
print_r($GLOBALS);
echo "</pre>";
alias.addnw=!sh -c 'git diff -U0 -w --no-color "$@" | git apply --cached --ignore-whitespace --unidiff-zero -'