if (Registry::exists('key')) { // do something } else { // key does not exist }
if (Registry::exists('key')) { Registry::delete('key'); }The code examples use the PHP Registry pattern which is implemented in many PHP packages and libraries, such as the Symfony DependencyInjection component or the Zend Framework.