SplObjectStorage::offsetExists

Checks whether an object exists in the storage

&reftitle.description; public `bool` `SplObjectStorage::offsetExists` `object` `object`

Checks whether an `object` exists in the storage.

`SplObjectStorage::offsetExists` is an alias of `SplObjectStorage::contains`.

&reftitle.parameters;

`object`

- The `object` to look for.

&reftitle.returnvalues;

Returns &true; if the `object` exists in the storage, and &false; otherwise.

&reftitle.examples;

### `SplObjectStorage::offsetExists` example

    <?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])
    ?>

&example.outputs.similar;

    bool(true)
    bool(false)

&reftitle.seealso;

- `SplObjectStorage::offsetSet`
- `SplObjectStorage::offsetGet`
- `SplObjectStorage::offsetUnset`