ID:               25410
 Updated by:       [EMAIL PROTECTED]
 Reported By:      xuefer at 21cn dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Scripting Engine problem
 Operating System: win
 PHP Version:      4.3.3
 New Comment:

Fixed in PHP 5. (ZE2, won't fix in PHP 4)





Previous Comments:
------------------------------------------------------------------------

[2003-09-07 06:13:39] xuefer at 21cn dot com

Description:
------------
the 1st code make apache crash, and the 2nd make apache freeze, taking
full cpu usage
notice that the "exit" statement is important
noting will happend when "exit" is removed

only class methods is affected, not function


Reproduce code:
---------------
crash:
<?php

class A
{
        function &getInstance()
        {
                if (empty($GLOBALS['a'])) {
                        $GLOBALS['a'] = &new A();
                }
                return $GLOBALS['a'];
        }
}

$a = &A::getInstance();
exit;

?>

freeze:
<?php

class A
{
        function &getInstance()
        {
                return $GLOBALS['a'];
        }
}

$a = &A::getInstance();
exit;

?>




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25410&edit=1

Reply via email to