array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'it', ), 'this' => array ( 0 => 'splobjectstorage.contains.php', 1 => 'SplObjectStorage::contains', 2 => 'Checks if the storage contains a specific object', ), 'up' => array ( 0 => 'class.splobjectstorage.php', 1 => 'SplObjectStorage', ), 'prev' => array ( 0 => 'splobjectstorage.attach.php', 1 => 'SplObjectStorage::attach', ), 'next' => array ( 0 => 'splobjectstorage.count.php', 1 => 'SplObjectStorage::count', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/splobjectstorage/contains.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
SplObjectStorage::contains — Checks if the storage contains a specific object
Checks if the storage contains the object provided.
Example #1 SplObjectStorage::contains() example
<?php
$o1 = new stdClass;
$o2 = new stdClass;
$s = new SplObjectStorage();
$s[$o1] = "hello";
var_dump($s->contains($o1));
var_dump($s->contains($o2));
?>
Il precedente esempio visualizzerĂ qualcosa simile a:
bool(true) bool(false)