From:             [EMAIL PROTECTED]
Operating system: Gentoo
PHP version:      5.2.3
PHP Bug Type:     SPL related
Bug description:  ArrayObject shows wierd behaviour in respect to inheritance

Description:
------------
See the code for best description, what happens...

Reproduce code:
---------------
class Bar extends ArrayObject {
    private $foo = array( 1, 2, 3 );
    function __construct() 
    {
       parent::__construct($this->foo);
    }
}

$foo = new Bar();
var_dump($foo);
object(Bar)#1 (3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}

$foo['foo'] = 23;
var_dump($foo);
object(Bar)#1 (4) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
  ["foo"]=>
  int(23)
}

$bar = new Bar();
var_dump($bar);
object(Bar)#2 (4) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
  ["foo"]=>
  int(23)
}

Expected result:
----------------
The second instance should have a clean array instead of the array which
the first one got.


-- 
Edit bug report at http://bugs.php.net/?id=41692&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41692&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41692&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41692&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41692&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41692&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41692&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41692&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41692&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41692&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41692&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41692&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41692&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41692&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41692&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41692&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41692&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41692&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41692&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41692&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41692&r=mysqlcfg

Reply via email to