From: ross dot lawley at gmail dot com
Operating system: Linux
PHP version: 5.2.1
PHP Bug Type: Class/Object related
Bug description: ArrayObject::__desctruct ignores ARRAY_AS_PROPS
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 bug report at http://bugs.php.net/?id=41186&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41186&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41186&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41186&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41186&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41186&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41186&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41186&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41186&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41186&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41186&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41186&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41186&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41186&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41186&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41186&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41186&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41186&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41186&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41186&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41186&r=mysqlcfg