mirror of
https://github.com/php/php-src.git
synced 2024-12-12 03:15:29 +08:00
22 lines
452 B
PHP
22 lines
452 B
PHP
--TEST--
|
|
Bug #32799 (crash: calling the corresponding global var during the destruct)
|
|
--FILE--
|
|
<?php
|
|
class test{
|
|
public $c=1;
|
|
function __destruct (){
|
|
if (!isset($GLOBALS['p'])) {
|
|
echo "NULL\n";
|
|
} else {
|
|
$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--
|
|
NULL
|