ID:               32852
 Updated by:       [EMAIL PROTECTED]
 Reported By:      cox at idecnet dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Linux
 PHP Version:      5.0.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip




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

[2005-04-27 12:44:58] cox at idecnet dot com

Description:
------------
Crash with singleton() and __destruct(), see below.

Tomas V.V.Cox

Reproduce code:
---------------
<?php
class crashme {
    private static $instance = null;

    public function __construct() {
        self::$instance = $this;
    }

    public function __destruct() {
        echo "i'm called\n";
    }

    public static function singleton() {
        if (!isset(self::$instance)) {
            self::$instance = new crashme();
        }
        return self::$instance;
    }
}

crashme::singleton();
?>

Expected result:
----------------
i'm called

Actual result:
--------------
i'm called
i'm called
Segmentation fault (core dumped)



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


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

Reply via email to