xref: /PHP-8.3/tests/output/ob_013.phpt (revision e36a5a11)
1--TEST--
2output buffering - handlers/status
3--FILE--
4<?php
5function a($s){return $s;}
6function b($s){return $s;}
7function c($s){return $s;}
8function d($s){return $s;}
9
10ob_start();
11ob_start('a');
12ob_start('b');
13ob_start('c');
14ob_start('d');
15ob_start();
16
17echo "foo\n";
18
19ob_flush();
20ob_end_clean();
21ob_flush();
22
23print_r(ob_list_handlers());
24print_r(ob_get_status());
25print_r(ob_get_status(true));
26
27?>
28--EXPECTF--
29foo
30Array
31(
32    [0] => default output handler
33    [1] => a
34    [2] => b
35    [3] => c
36    [4] => d
37)
38Array
39(
40    [name] => d
41    [type] => 1
42    [flags] => 20593
43    [level] => 4
44    [chunk_size] => %d
45    [buffer_size] => 16384
46    [buffer_used] => 96
47)
48Array
49(
50    [0] => Array
51        (
52            [name] => default output handler
53            [type] => 0
54            [flags] => 112
55            [level] => 0
56            [chunk_size] => %d
57            [buffer_size] => 16384
58            [buffer_used] => 0
59        )
60
61    [1] => Array
62        (
63            [name] => a
64            [type] => 1
65            [flags] => 113
66            [level] => 1
67            [chunk_size] => %d
68            [buffer_size] => 16384
69            [buffer_used] => 0
70        )
71
72    [2] => Array
73        (
74            [name] => b
75            [type] => 1
76            [flags] => 113
77            [level] => 2
78            [chunk_size] => %d
79            [buffer_size] => 16384
80            [buffer_used] => 0
81        )
82
83    [3] => Array
84        (
85            [name] => c
86            [type] => 1
87            [flags] => 113
88            [level] => 3
89            [chunk_size] => %d
90            [buffer_size] => 16384
91            [buffer_used] => 4
92        )
93
94    [4] => Array
95        (
96            [name] => d
97            [type] => 1
98            [flags] => 20593
99            [level] => 4
100            [chunk_size] => %d
101            [buffer_size] => 16384
102            [buffer_used] => %d
103        )
104
105)
106