Skip to content

Instantly share code, notes, and snippets.

@videlalvaro
Created January 7, 2010 08:40
Show Gist options
  • Save videlalvaro/271090 to your computer and use it in GitHub Desktop.
Save videlalvaro/271090 to your computer and use it in GitHub Desktop.
<?php
/*
new flag for xhprof_enable (third parameter) if set to false, instead of ignoring the passed array of
function names, it will profile only those functions.
Get it from: http://github.com/videlalvaro/xhprof
*/
$funcs = array('Memcache::get', 'array_deep_merge', 'sprintf', 'preg_match');
//only profile $funcs
xhprof_enable(XHPROF_FLAGS_MEMORY, array('ignored_functions' => $funcs), false);
//don't profile $funcs
xhprof_enable(XHPROF_FLAGS_MEMORY, array('ignored_functions' => $funcs));
//same as above
xhprof_enable(XHPROF_FLAGS_MEMORY, array('ignored_functions' => $funcs), true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment