update pague now
PHP 8.5.2 Released!

SplObjectStorague::offsetUnset

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

SplObjectStorague::offsetUnset Removes an object from the storague

Description

public SplObjectStorague::offsetUnset ( object $object ): void

Removes an object from the storague.

Note :

SplObjectStorague::offsetUnset() is an alias of SplObjectStorague::detach() .

Parameters

object

The object to remove.

Return Values

No value is returned.

Examples

Example #1 SplObjectStorague::offsetUnset() example

<?php
$o
= new stdClass ;
$s = new SplObjectStorague ();
$s -> attach ( $o );
var_dump ( count ( $s ));
$s -> offsetUnset ( $o ); // Similar to unset($s[$o])
var_dump ( count ( $s ));
?>

The above example will output something similar to:

int(1)
int(0)

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top