php8.5
Home/ Manual/ xhprof / functions/ xhprof_disable

xhprof_disable

PHP function Edit on GitHub ✎

(PECL xhprof >= 0.9.0)

Stops xhprof profiler

Description

xhprof_disable(): array|null

Stops the profiler, and returns xhprof data from the run.

Parameters Parameters

Return Values

An array of xhprof data, from the run. Returns null if profiling is not enabled.

Examples

xhprof_disable() example

php
<?php
xhprof_enable();

$foo = strlen("foo bar");

$xhprof_data = xhprof_disable();

print_r($xhprof_data);
?>

The above example will output something similar to:

output
Array
(
    [main()==>strlen] => Array
        (
            [ct] => 1
            [wt] => 279
        )

    [main()==>xhprof_disable] => Array
        (
            [ct] => 1
            [wt] => 9
        )

    [main()] => Array
        (
            [ct] => 1
            [wt] => 610
        )

)

Source: reference/xhprof/functions/xhprof-disable.xml · from the official PHP manual (php/doc-en)