summaryrefslogtreecommitdiff
path: root/Zend/tests/bug32799.phpt
blob: 18b5a1e8c6556415cfe0bab4f4235b30db953635 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--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)
}
--UEXPECT--
2
object(test)#1 (1) {
  [u"c"]=>
  int(2)
}