summaryrefslogtreecommitdiff
path: root/Zend/tests/bug65372.phpt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2013-08-02 18:37:15 +0800
committerXinchen Hui <laruence@php.net>2013-08-02 18:37:15 +0800
commitce9169e360701ea3b1ab2366171c24d4de5e78e3 (patch)
tree7c6a94f1258a49a4bf515cff7e997b12120bbd8d /Zend/tests/bug65372.phpt
parentcb13f8318b39f72798c3756dcfe55daae4c932e2 (diff)
downloadphp-git-ce9169e360701ea3b1ab2366171c24d4de5e78e3.tar.gz
Fixed bug Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
Diffstat (limited to 'Zend/tests/bug65372.phpt')
-rw-r--r--Zend/tests/bug65372.phpt40
1 files changed, 40 insertions, 0 deletions
diff --git a/Zend/tests/bug65372.phpt b/Zend/tests/bug65372.phpt
new file mode 100644
index 0000000000..50fc2dbb1b
--- /dev/null
+++ b/Zend/tests/bug65372.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
+--FILE--
+<?php
+
+class ParentClass
+{
+ private static $_OBJECTS;
+
+ public static function Get()
+ {
+ self::$_OBJECTS[1] = new ChildClass();
+ return self::$_OBJECTS[1];
+ }
+}
+
+class ChildClass extends ParentClass
+{
+ public $Manager;
+
+ function __construct()
+ {
+ $this->Manager = $this;
+ }
+
+ public static function &GetCurrent()
+ {
+ return ChildClass::Get();
+ }
+
+ public static function &Get()
+ {
+ return parent::Get();
+ }
+}
+
+$staff = ChildClass::GetCurrent();
+?>
+--EXPECTF--
+Notice: Only variable references should be returned by reference in %sbug65372.php on line 30