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

search for in the

SplObjectStorage::offsetGet> <SplObjectStorage::next
[edit] Last updated: Fri, 25 May 2012

view this page in

SplObjectStorage::offsetExists

(PHP 5 >= 5.3.0)

SplObjectStorage::offsetExistsVérifie si un objet existe dans le stockage

Description

public bool SplObjectStorage::offsetExists ( object $object )

Vérifie si un objet existe dans un stockage.

Liste de paramètres

object

L'objet à rechercher.

Valeurs de retour

Retourne TRUE si l'objet existe, et FALSE sinon.

Exemples

Exemple #1 Exemple avec SplObjectStorage::offsetExists()

<?php
$s 
= new SplObjectStorage;
$o1 = new StdClass;
$o2 = new StdClass;

$s->attach($o1);

var_dump($s->offsetExists($o1)); // Similar to isset($s[$o1])
var_dump($s->offsetExists($o2)); // Similar to isset($s[$o2])
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

bool(true)
bool(false)

Voir aussi



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

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