summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/lang/bug24573.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lang/bug24573.phpt b/tests/lang/bug24573.phpt
new file mode 100644
index 0000000000..a7c8ac5ca5
--- /dev/null
+++ b/tests/lang/bug24573.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #24573 (debug_backtrace() crashes if $this is set to null)
+--FILE--
+<?php
+
+class Foo {
+ function Bar() {
+ $__this = $this;
+ $this = null;
+ debug_backtrace();
+ $this = $__this;
+ }
+}
+
+$f = new Foo;
+
+$f->Bar();
+
+echo "OK\n";
+
+?>
+--EXPECT--
+OK