ID: 22231
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Verified
Bug Type: Class/Object related
-Operating System: Windows 2000
+Operating System: Windows 2000 / Linux
-PHP Version: 4.3.0
+PHP Version: 4.3.0 / 4CVS-2002-02-16 / 5CVS-2002-02-16
New Comment:
Verified with HEAD / PHP_4_3 branch.
The following script causes segfault under php-4.2.3, php-4.3.0,
php-5.0.0dev.
<?php
class foo {
var $fubar = 'fubar';
}
function &foo(){
$GLOBALS['foo'] = &new foo();
return $GLOBALS['foo'];
}
$foo = &foo();
var_dump($foo);
var_dump($foo->fubar);
unset($foo);
$foo = &foo();
var_dump($foo->fubar);
?>
Previous Comments:
------------------------------------------------------------------------
[2003-02-15 08:39:33] [EMAIL PROTECTED]
The following script causes my Apache 2.0.43 to crash.
It is repoducable.
PHP 4.3.0 runs as an module.
<?php
class foo {
var $test = 'test';
function bar()
{
echo $this->test;
}
}
function &getFoo()
{
$GLOBALS['foo'] =& new foo();
return $GLOBALS['foo'];
}
$foo =& getFoo();
$foo->bar();
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22231&edit=1