downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SplObjectStorage::rewind> <SplObjectStorage::removeAll
Last updated: Fri, 20 May 2011

view this page in

SplObjectStorage::removeAllExcept

(PHP 5 >= 5.3.6)

SplObjectStorage::removeAllExceptRemoves all objects except for those contained in another storage from the current storage

Descripción

public void SplObjectStorage::removeAllExcept ( SplObjectStorage $storage )

Removes all objects except for those contained in another storage from the current storage.

Parámetros

storage

The storage containing the elements to retain in the current storage.

Valores devueltos

No devuelve ningún valor.

Ejemplos

Example #1 SplObjectStorage::removeAllExcept() example

<?php
$a 
= (object) 'a'
$b = (object) 'b'
$c = (object) 'c'

$foo = new SplObjectStorage;
$foo->attach($a);
$foo->attach($b);

$bar = new SplObjectStorage;
$bar->attach($b);
$bar->attach($c);

$foo->removeAllExcept($bar);
var_dump($foo->contains($a));
var_dump($foo->contains($b));
?>

El resultado del ejemplo sería algo similar a:

bool(false)
bool(true)



add a note add a note User Contributed Notes SplObjectStorage::removeAllExcept
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites