PHP 8.6.0 Beta 3 is available for testing

Yaf_Registry::del

(Yaf >=1.0.0)

Yaf_Registry::delRemove an item from registry

Descrizione

public static function Yaf_Registry::del(string $name): bool

Removes an entry from the registry. Removing a name that does not exist is silently accepted.

Elenco dei parametri

name

The name of the registry entry.

Valori restituiti

Always returns true.

Esempi

Example #1 Yaf_Registry::del() example

<?php
Yaf_Registry::set("redis", new Redis());
var_dump(Yaf_Registry::has("redis"));

var_dump(Yaf_Registry::del("redis"));
var_dump(Yaf_Registry::has("redis"));

/* deleting a missing entry is silently accepted */
var_dump(Yaf_Registry::del("redis"));
?>

Il precedente esempio visualizzerà qualcosa simile a:

bool(true)
bool(true)
bool(false)
bool(true)

Vedere anche:

add a note

User Contributed Notes

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