summaryrefslogtreecommitdiff
path: root/Zend/tests/bug30828.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-06-23 09:23:24 +0000
committerDmitry Stogov <dmitry@php.net>2005-06-23 09:23:24 +0000
commitf17f5da8af687a021913b7632c1baebbc990cd12 (patch)
tree39ccaea08efdbfa23417ecf130141cbf4c2df66e /Zend/tests/bug30828.phpt
parent2037023874df83d47bdf96694a1615ae8281cef7 (diff)
downloadphp-git-f17f5da8af687a021913b7632c1baebbc990cd12.tar.gz
Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden methods)
Diffstat (limited to 'Zend/tests/bug30828.phpt')
-rwxr-xr-xZend/tests/bug30828.phpt61
1 files changed, 61 insertions, 0 deletions
diff --git a/Zend/tests/bug30828.phpt b/Zend/tests/bug30828.phpt
new file mode 100755
index 0000000000..d05dbb606d
--- /dev/null
+++ b/Zend/tests/bug30828.phpt
@@ -0,0 +1,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