helly           Sat Apr  1 22:39:42 2006 UTC

  Added files:                 
    /php-src/ext/spl/tests      bug36941.phpt 

  Modified files:              
    /php-src/ext/spl    spl_array.c 
  Log:
  - Bugfix #36941 (ArrayIterator does not clone itself)
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_array.c?r1=1.105&r2=1.106&diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.105 php-src/ext/spl/spl_array.c:1.106
--- php-src/ext/spl/spl_array.c:1.105   Sat Apr  1 19:14:01 2006
+++ php-src/ext/spl/spl_array.c Sat Apr  1 22:39:42 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_array.c,v 1.105 2006/04/01 19:14:01 tony2001 Exp $ */
+/* $Id: spl_array.c,v 1.106 2006/04/01 22:39:42 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -228,6 +228,7 @@
        spl_array_object *intern;
 
        old_object = zend_objects_get_address(zobject TSRMLS_CC);
+       SEPARATE_ZVAL(&zobject);
        new_obj_val = spl_array_object_new_ex(old_object->ce, &intern, zobject 
TSRMLS_CC);
        new_object = &intern->std;
 

http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/tests/bug36941.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/bug36941.phpt
+++ php-src/ext/spl/tests/bug36941.phpt
--TEST--
Bug #36941 (ArrayIterator does not clone itself)
--FILE--
<?php
$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]);
$b[0] = 3;
var_dump($a[0], $b[0]);
?>
===DONE===
--EXPECT--
int(1)
int(1)
int(1)
int(2)
int(1)
int(3)
===DONE===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to