Bug #51822 [Opn->Fbk]: Segfault with strange __destruct() for static class variables
| From: | felipe@php.net | Date: | Fri, 14 May 2010 12:58:06 +0000 |
| Subject: | Bug #51822 [Opn->Fbk]: Segfault with strange __destruct() for static class variables | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150467@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51822&edit=1
ID: 51822
Updated by: felipe@php.net
Reported by: daan at react dot com
Summary: Segfault with strange __destruct() for static class
variables
-Status: Open
+Status: Feedback
Type: Bug
Package: Scripting Engine problem
Operating System: Debian Etch
PHP Version: 5.2.13
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
I cannot reproduce it on 5_2 SVN.
Previous Comments:
------------------------------------------------------------------------
[2010-05-14 14:38:49] daan at react dot com
Description:
------------
When a static class variable is assigned a nested destructable object,
it behaves differently when assigned before or after the instantiation
an object of the class to which the static property belongs.
When the variable is assigned after object instantiation, the process
segfaults.
(tested: PHP 5.3.1 behaves correctly)
Test script:
---------------
<?php
class DestructableObject
{
public function __destruct()
{
}
}
class DestructorCreator
{
public function __destruct()
{
$this->test = new DestructableObject;
}
}
class Test
{
public static $mystatic;
}
// Uncomment this to avoid segfault
//Test::$mystatic = new DestructorCreator();
$x = new Test();
if (!isset(Test::$mystatic))
Test::$mystatic = new DestructorCreator();
echo 'bla';
Expected result:
----------------
bla
Actual result:
--------------
Segfault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51822&edit=1