Created
October 26, 2015 15:51
-
-
Save jbenesch/f6100cce47a6a894f0ba to your computer and use it in GitHub Desktop.
Simple php inspection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function performance($label) { | |
$time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]; | |
$memory = memory_get_usage(); | |
$functions = get_defined_functions(); | |
echo "<pre>"; | |
echo "LABEL: $label\n"; | |
echo "TIME: $time\n"; | |
echo "MEM: $memory\n"; | |
print_r(array_diff($functions["user"], $GLOBALS['remove_wp_funcs'])); | |
print_r(array_reverse(debug_backtrace())); | |
unset($GLOBALS['remove_wp_funcs']); | |
unset($GLOBALS['functions']); | |
unset($GLOBALS['wp_filter']); | |
unset($GLOBALS['allowedposttags']); | |
unset($GLOBALS['allowedtags']); | |
unset($GLOBALS['allowedentitynames']); | |
print_r($GLOBALS); | |
echo "</pre>"; | |
exit; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment