mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach
28 lines
496 B
PHP
28 lines
496 B
PHP
--TEST--
|
|
Check that SplObjectStorage::removeUncommon functions when receiving proper input
|
|
--CREDITS--
|
|
Matthew Turland (me@matthewturland.com)
|
|
--FILE--
|
|
<?php
|
|
|
|
$a = (object) 'a';
|
|
$b = (object) 'b';
|
|
$c = (object) 'c';
|
|
|
|
$foo = new SplObjectStorage;
|
|
$foo->offsetSet($a);
|
|
$foo->offsetSet($b);
|
|
|
|
$bar = new SplObjectStorage;
|
|
$bar->offsetSet($b);
|
|
$bar->offsetSet($c);
|
|
|
|
$foo->removeAllExcept($bar);
|
|
var_dump($foo->offsetExists($a));
|
|
var_dump($foo->offsetExists($b));
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|
|
bool(true)
|