summaryrefslogtreecommitdiff
path: root/Zend/tests/bug30828.phpt
blob: d05dbb606dcd283f3d12c73ecdeca85171d7c3a2 (plain)
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
60
61
--TEST--
Bug #30828 (debug_backtrace() reports incorrect class in overridden methods)
--FILE--
<?php
class A {
	function __construct() {
		debug_print_backtrace();
		$bt = debug_backtrace();
		foreach ($bt as $t) {
			print $t['class'].$t['type'].$t['function']."\n";
		}
	}

	function foo() {
		debug_print_backtrace();
		$bt = debug_backtrace();
		foreach ($bt as $t) {
                        print $t['class'].$t['type'].$t['function']."\n";
		}
	}

	static function bar() {
		debug_print_backtrace();
		$bt = debug_backtrace();
		foreach ($bt as $t) {
			print $t['class'].$t['type'].$t['function']."\n";
		}
	}
}

class B extends A {
	function __construct() {
		parent::__construct();
	}

	function foo() {
		parent::foo();
	}

	static function bar() {
		parent::bar();
	}
}

$b = new B();
$b->foo();
B::bar();
?>
--EXPECTF--
#0  A->__construct() called at [%sbug30828.php:30]
#1  B->__construct() called at [%sbug30828.php:42]
A->__construct
B->__construct
#0  A->foo() called at [%sbug30828.php:34]
#1  B->foo() called at [%sbug30828.php:43]
A->foo
B->foo
#0  A::bar() called at [%sbug30828.php:38]
#1  B::bar() called at [%sbug30828.php:44]
A::bar
B::bar