summaryrefslogtreecommitdiff
path: root/ext/spl/tests/observer_009.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/observer_009.phpt')
-rw-r--r--ext/spl/tests/observer_009.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/spl/tests/observer_009.phpt b/ext/spl/tests/observer_009.phpt
new file mode 100644
index 0000000..6ac676c
--- /dev/null
+++ b/ext/spl/tests/observer_009.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SPL: SplObjectStorage addAll/removeAll
+--FILE--
+<?php
+class Foo {}
+
+$storageA = new \SplObjectStorage();
+$storageA->attach(new \Foo);
+$storageA->attach(new \Foo);
+
+echo ("Count storage A: " . count($storageA));
+foreach ($storageA as $object) {
+ echo ' x ';
+}
+
+echo "\n";
+$storageB = clone $storageA;
+
+echo ("Count storage B: " . count($storageB));
+foreach ($storageB as $object) {
+ echo ' x ';
+}
+echo "\n";
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Count storage A: 2 x x
+Count storage B: 2 x x
+===DONE===