File: flamegraph-005.phpt

package info (click to toggle)
xdebug 3.4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,096 kB
  • sloc: ansic: 19,944; php: 6,217; xml: 4,172; pascal: 534; makefile: 4; sh: 2
file content (59 lines) | stat: -rw-r--r-- 782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--TEST--
Tracing: Flamegraph with "start with request"
--INI--
xdebug.mode=trace
xdebug.start_with_request=yes
xdebug.trace_output_name=trace.%p.%r
xdebug.trace_format=3
--FILE--
<?php
$tf = xdebug_get_tracefile_name();

function ABB() {
}

function ABA() {
}

function AC() {
}

function AB() {
    ABA();
    ABB();
}

function AA() {
}

function A() {
    AA();
    AB();
    AA();
    AB();
    AC();
}

A();

xdebug_stop_trace();

if (preg_match('@\.gz$@', $tf)) {
	$fp = gzopen($tf, 'r');
	echo stream_get_contents($fp);
} else {
	echo file_get_contents($tf);
}
?>
--EXPECTF--
{main};xdebug_get_tracefile_name %d
{main};A;AA %d
{main};A;AB;ABA %d
{main};A;AB;ABB %d
{main};A;AB %d
{main};A;AA %d
{main};A;AB;ABA %d
{main};A;AB;ABB %d
{main};A;AB %d
{main};A;AC %d
{main};A %d