mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Add test covering for #47671
This commit is contained in:
parent
47aa4817f3
commit
24835e7fb1
1 changed files with 30 additions and 0 deletions
30
ext/spl/tests/observer_009.phpt
Normal file
30
ext/spl/tests/observer_009.phpt
Normal file
|
@ -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===
|
Loading…
Add table
Add a link
Reference in a new issue