php8.5
Home/ Manual/ ds / pair/ Ds\Pair::clear

Ds\Pair::clear

PHP function Edit on GitHub ✎

Removes all values

Description

Ds\Pair::clear(): void

Removes all values from the pair.

Parameters Parameters

Return Values

Void

Examples

Ds\Pair::clear() example

php
<?php
$pair = new \Ds\Pair("a", 1);
print_r($pair);

$pair->clear();
print_r($pair);
?>

The above example will output something similar to:

output
Ds\Pair Object
(
    [key] => a
    [value] => 1
)
Ds\Pair Object
(
)

Source: reference/ds/ds/pair/clear.xml · from the official PHP manual (php/doc-en)