1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/spl/tests/bug36941.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

45 lines
564 B
PHP

--TEST--
Bug #36941 (ArrayIterator does not clone itself)
--FILE--
===ArrayObject===
<?php
$a = new ArrayObject();
$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]);
?>
===ArrayIterator===
<?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]);
?>
--EXPECT--
===ArrayObject===
int(1)
int(1)
int(1)
int(2)
int(1)
int(3)
===ArrayIterator===
int(1)
int(1)
int(2)
int(2)
int(3)
int(3)