summaryrefslogtreecommitdiff
path: root/Zend/tests/bug32799.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-06-06 10:38:43 +0000
committerDmitry Stogov <dmitry@php.net>2005-06-06 10:38:43 +0000
commitce23692663fe377111d79bc03cba88c21626841c (patch)
treeaf61a83ebda24f40a840c1a1fad8b7e60cfe5872 /Zend/tests/bug32799.phpt
parente5d3e078621018b01a5c0ee443a9547ab41754a7 (diff)
downloadphp-git-ce23692663fe377111d79bc03cba88c21626841c.tar.gz
Fixed bug #32799 (crash: calling the corresponding global var during the destruct)
Diffstat (limited to 'Zend/tests/bug32799.phpt')
-rwxr-xr-xZend/tests/bug32799.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Zend/tests/bug32799.phpt b/Zend/tests/bug32799.phpt
new file mode 100755
index 0000000000..7b09a50274
--- /dev/null
+++ b/Zend/tests/bug32799.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #32799 (crash: calling the corresponding global var during the destruct)
+--FILE--
+<?php
+class test{
+ public $c=1;
+ function __destruct (){
+ $GLOBALS['p']->c++; // no warning
+ print $GLOBALS['p']->c."\n"; // segfault
+ var_dump($GLOBALS['p']);
+ }
+}
+$p=new test;
+$p=null; //destroy the object by a new assignment (segfault)
+?>
+--EXPECT--
+2
+object(test)#1 (1) {
+ ["c"]=>
+ int(2)
+}