xref: /PHP-5.6/Zend/tests/closure_032.phpt (revision c6d89bd4)
1--TEST--
2Closure 032: Testing Closure and debug_backtrace
3--FILE--
4<?php
5
6function test(closure $a) {
7        $a(23);
8}
9
10
11$c = function($param) { print_r(debug_backtrace()); debug_print_backtrace(); };
12
13$c(23);
14test($c);
15?>
16--EXPECTF--
17Array
18(
19    [0] => Array
20        (
21            [file] => %s
22            [line] => %d
23            [function] => {closure}
24            [args] => Array
25                (
26                    [0] => 23
27                )
28
29        )
30
31)
32#0  {closure}(23) called at [%s:%d]
33Array
34(
35    [0] => Array
36        (
37            [file] => %s
38            [line] => %d
39            [function] => {closure}
40            [args] => Array
41                (
42                    [0] => 23
43                )
44
45        )
46
47    [1] => Array
48        (
49            [file] => %s
50            [line] => %d
51            [function] => test
52            [args] => Array
53                (
54                    [0] => Closure Object
55                        (
56                            [parameter] => Array
57                                (
58                                    [$param] => <required>
59                                )
60
61                        )
62
63                )
64
65        )
66
67)
68#0  {closure}(23) called at [%s:%d]
69#1  test(Closure Object ()) called at [%s:%d]
70
71