Yaf_Registry::del

Remove an item from registry

Description

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

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

Parameters

name
The name of the registry entry.

Return Values

Always returns true.

Examples

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"));
?>

The above example will output something similar to:

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

See Also

  • Yaf_Registry::get
  • Yaf_Registry::set
  • Yaf_Registry::has