|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2003-02-15 08:39 UTC] henrik dot gebauer at web dot de
 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();
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 13:00:01 2025 UTC | 
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); ?>