array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), '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); ?>

SplObjectStorage::contains

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

SplObjectStorage::containsChecks if the storage contains a specific object

Uyarı

This function has been DEPRECATED as of PHP 8.5.0. Relying on this function is highly discouraged.

Açıklama

#[\Deprecated]
public SplObjectStorage::contains(object $object): bool

Checks if the storage contains the object provided.

Bağımsız Değişkenler

object

The object to look for.

Dönen Değerler

Returns true if the object is in the storage, false otherwise.

Örnekler

Örnek 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));
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

bool(true)
bool(false)

Ayrıca Bakınız