xref: /PHP-8.2/Zend/tests/bug64239_2.phpt (revision f8d79582)
1--TEST--
2Bug #64239 (debug_backtrace() changed behavior)
3--FILE--
4<?php
5class A {
6    use T1;
7    public function test() { $this->backtrace(); }
8}
9
10class B {
11    use T2 { t2method as Bmethod; }
12}
13
14class C extends A {
15}
16
17trait T1 {
18    protected function backtrace() {
19        $b = new B();
20        $b->Bmethod();
21    }
22}
23trait T2 {
24    public function t2method() {
25        print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1));
26    }
27}
28$a = new A();
29$a->test();
30
31$c = new C();
32$c->test();
33?>
34--EXPECTF--
35Array
36(
37    [0] => Array
38        (
39            [file] => %sbug64239_2.php
40            [line] => %d
41            [function] => Bmethod
42            [class] => B
43            [type] => ->
44        )
45
46)
47Array
48(
49    [0] => Array
50        (
51            [file] => %sbug64239_2.php
52            [line] => %d
53            [function] => Bmethod
54            [class] => B
55            [type] => ->
56        )
57
58)
59