summaryrefslogtreecommitdiff
path: root/Zend/tests/bug64720.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2013-05-21 09:58:11 +0400
committerDmitry Stogov <dmitry@zend.com>2013-05-21 09:58:11 +0400
commit77fffff15762137e2d8173df9b733b4cb70fc996 (patch)
tree6f6f604eb848d770c1147470cdc811dc058da0ba /Zend/tests/bug64720.phpt
parent1124b0678f9e60384736c7c1a0d1e84c633a5e7a (diff)
downloadphp-git-77fffff15762137e2d8173df9b733b4cb70fc996.tar.gz
Fixed bug #64720 (SegFault on zend_deactivate)
Diffstat (limited to 'Zend/tests/bug64720.phpt')
-rw-r--r--Zend/tests/bug64720.phpt48
1 files changed, 48 insertions, 0 deletions
diff --git a/Zend/tests/bug64720.phpt b/Zend/tests/bug64720.phpt
new file mode 100644
index 0000000000..6c33165bb5
--- /dev/null
+++ b/Zend/tests/bug64720.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Bug #64720 (SegFault on zend_deactivate)
+--FILE--
+<?php
+class Stat {
+ private static $requests;
+ public static function getInstance() {
+ if (!isset(self::$requests[1])) {
+ self::$requests[1] = new self();
+ }
+ return self::$requests[1];
+ }
+
+ public function __destruct() {
+ unset(self::$requests[1]);
+ }
+}
+
+class Foo {
+ public function __construct() {
+ Stat::getInstance();
+ }
+}
+
+class Error {
+ private $trace;
+ public function __construct() {
+ $this->trace = debug_backtrace(1);
+ }
+}
+
+class Bar {
+ public function __destruct() {
+ Stat::getInstance();
+ new Error();
+ }
+
+ public function test() {
+ new Error();
+ }
+}
+
+$foo = new Foo();
+$bar = new Bar();
+$bar->test();
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12