|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41186 ArrayObject::__desctruct ignores ARRAY_AS_PROPS
Submitted: 2007-04-25 14:27 UTC Modified: 2008-11-10 01:00 UTC
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ross dot lawley at gmail dot com Assigned: helly (profile)
Status: No Feedback Package: Class/Object related
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ross dot lawley at gmail dot com
New email:
PHP Version: OS:


 [2007-04-25 14:27 UTC] ross dot lawley at gmail dot com
ArrayObject::ARRAY_AS_PROPS fails to work in the __destruct method

Reproduce code:
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;

// Lets destroy the object by reusing the variable
$myArrayObject = 1;

echo 'Test Completed';

Expected result:
Test Completed

Actual result:
( ! ) 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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-02 12:41 UTC]
Please try using this CVS snapshot:
For Windows:

 [2008-11-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 06:01:35 2024 UTC