#41186 [Opn->Asn]: ArrayObject::__desctruct ignores ARRAY_AS_PROPS
| From: | tony2001@php.net | Date: | Wed, 25 Apr 2007 20:20:05 +0000 |
| Subject: | #41186 [Opn->Asn]: ArrayObject::__desctruct ignores ARRAY_AS_PROPS | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111901@lists.php.net to get a copy of this message | ||
ID: 41186
Updated by: tony2001@php.net
Reported By: ross dot lawley at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Class/Object related
Operating System: Linux
PHP Version: 5.2.1
-Assigned To:
+Assigned To: helly
Previous Comments:
------------------------------------------------------------------------
[2007-04-25 14:27:19] ross dot lawley at gmail dot com
Description:
------------
ArrayObject::ARRAY_AS_PROPS fails to work in the __destruct method
Reproduce code:
---------------
<?php
class destructTest extends ArrayObject
{
public function __construct( )
{
$defaults = array('hello' => "world\n");
parent::__construct($defaults, ArrayObject::ARRAY_AS_PROPS);
}
public function say( )
{
echo $this->hello;
}
public function __destruct()
{
echo $this->hello;
}
}
$myArrayObject = new destructTest;
$myArrayObject->say();
// Lets destroy the object by reusing the variable
$myArrayObject = 1;
echo 'Test Completed';
?>
Expected result:
----------------
world
world
Test Completed
Actual result:
--------------
world
( ! ) Notice: Undefined property: destructTest::$hello in
/home/ross/www/tmp/arrayObject.php on line 18
Call Stack
# Time Memory Function Location
1 0.0002 60400 {main}( ) ../arrayObject.php:0
2 0.0003 61216 destructTest->__destruct( ) ../arrayObject.php:0
Test Completed
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41186&edit=1