Skip to content

Instantly share code, notes, and snippets.

@werner-freytag
Last active August 29, 2015 14:23
Show Gist options
  • Save werner-freytag/5ed658b19048707e593e to your computer and use it in GitHub Desktop.
Save werner-freytag/5ed658b19048707e593e to your computer and use it in GitHub Desktop.
One-liner for profiling a PHP page with XHProf
register_shutdown_function(function(){$d=xhprof_disable();uasort($d,function($a,$b){$k='wt';return$a[$k]>$b[$k]?-1:$a[$k]!=$b[$k];});var_export($d);});xhprof_enable();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment