From: rd dot contact at free dot fr
Operating system: xp
PHP version: 5.0.4
PHP Bug Type: Reproducible crash
Bug description: crash: calling the corresponding global var during the
destruct
Description:
------------
During the __destruct, when using the global var assigned to the object,
php crashes in some cases.
Reproduce code:
---------------
class test{
function __destruct (){
//$GLOBALS['p']=$this; // <- this crash apache for all tests
//$GLOBALS['p']++; // <- this crash apache for all tests
print_r($GLOBALS['p']); // <- crash only test 1. test 2 => "Undefined
variable p"
}
}
$p=new test;
//test 1
$p=1; // crash apache (as $p=null, $p='bug', $p=new test ...)
//but,
//test 2
//unset($p); // no crash: "Undefined variable: p on line 5"
Expected result:
----------------
No crash, and a way to use the global var during destruct.
(so destruct could call external functions that use the global var of the
object. Why not unregister the global var after the destruct call ?)
--
Edit bug report at http://bugs.php.net/?id=32799&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32799&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32799&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32799&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32799&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32799&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32799&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32799&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32799&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32799&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32799&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32799&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32799&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32799&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32799&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32799&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32799&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32799&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32799&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32799&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32799&r=mysqlcfg