(PECL xhprof >= 0.9.0)
xhprof_enable — 啟動 xhprof 性能分析器
##說明
void xhprof_enable ([ int $flags = 0 [, array $options ]] )
啟動 xhprof 進行性能分析。
##參數
flags
分析添加額外信息的可選標記。 關于此標記的更多信息參見 XHprof 常量,例如, XHPROF_FLAGS_MEMORY 可以開啟內存的分析。
options
array 的可選選項,就是通過傳遞 'ignored_functions' 選項來忽略性能分析中的某些函數。
##返回值
NULL
##更新日志
|版本 |說明|
|=|=|
|0.9.2 |添加可選的 options 參數。|
##范例
Example #1 xhprof_enable() 范例
```
<?php
// 1. elapsed time + memory + CPU profiling; and ignore built-in (internal) functions
xhprof_enable(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);
// 2. elapsed time profiling; ignore call_user_func* during profiling
xhprof_enable(
0,
array('ignored_functions' => array('call_user_func',
'call_user_func_array')));
// 3. elapsed time + memory profiling; ignore call_user_func* during profiling
xhprof_enable(
XHPROF_FLAGS_MEMORY,
array('ignored_functions' => array('call_user_func',
'call_user_func_array')));
?>
```