#32852 [Opn->Fbk]: Crash with singleton and __destruct
| From: | johannes@php.net | Date: | Wed, 27 Apr 2005 11:37:48 +0000 |
| Subject: | #32852 [Opn->Fbk]: Crash with singleton and __destruct | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78281@lists.php.net to get a copy of this message | ||
ID: 32852
Updated by: johannes@php.net
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:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-04-27 13:12:30] cox at idecnet dot com
With php5-STABLE-200504271035:
PHP 5.0.5-dev (cli) (built: Apr 27 2005 13:08:58)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
The bug is still there.
Tomas V.V.Cox
------------------------------------------------------------------------
[2005-04-27 12:52:31] tony2001@php.net
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
------------------------------------------------------------------------
[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