#36941 [NEW]: ArrayIterator does not clone itself

From: Date: Sat, 01 Apr 2006 14:29:26 +0000
Subject: #36941 [NEW]: ArrayIterator does not clone itself
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95187@lists.php.net to get a copy of this message
From:             ce at netage dot bg
Operating system: linux
PHP version:      5.1.3RC2
PHP Bug Type:     SPL related
Bug description:  ArrayIterator does not clone itself

Description:
------------
ArrayIterator does not clone itself

Reproduce code:
---------------
$a = new ArrayIterator();
$a[] = 1;

$b = clone $a;

var_dump($a[0], $b[0]);
$b[0] = $b[0] + 1;
var_dump($a[0], $b[0]);


Expected result:
----------------
int(1)
int(1)
int(1)
int(2)


Actual result:
--------------
int(1)
int(1)
int(2)
int(2)


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


Thread (4 messages)

« previous php.bugs (#95187) next »