Removes an object from the storage

# SplObjectStorage::detach

(PHP 5 >= 5.1.0, PHP 7)

SplObjectStorage::detach — Removes an object from the storage

### Descrierea

public SplObjectStorage::detach ( object `$object` ) : void

Removes the object from the storage.

### Parametri

`object`

  The object to remove.

### Valorile întoarse

Nu este întoarsă nici o valoare.

### Exemple

Example #1 SplObjectStorage::detach() example

`<?php
$o = new StdClass;
$s = new SplObjectStorage();
$s->attach($o);
var_dump(count($s));
$s->detach($o);
var_dump(count($s));
?>`

Exemplul de mai sus va afișa ceva similar cu:

    int(1)
    int(0)

### A se vedea și

- SplObjectStorage::attach() - Adds an object in the storage
- SplObjectStorage::removeAll() - Removes objects contained in another storage from the current storage