PHP 8.5.10 Released!

Yaf_Registry::del

(Yaf >=1.0.0)

Yaf_Registry::delRemove an item from registry

Опис

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.

Параметри

name

The name of the registry entry.

Значення, що повертаються

Always returns true.

Приклади

Приклад #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"));
?>

Поданий вище приклад виведе щось схоже на:

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

Прогляньте також

add a note

User Contributed Notes

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