Singleton: Porovnání verzí
Smazaný obsah Přidaný obsah
m Bot: Replace deprecated <source> tag and "enclose" parameter |
→Implementace v jazyce PHP: aktualizace pro aktuální verzi jazyka značky: revertováno editace z Vizuálního editoru |
||
Řádek 144:
class Singleton
{
private static $instance
private function __construct()
{
}
public static function getInstance()
{
if (self::$instance === self::$instance = new self();
}
Řádek 156 ⟶ 158:
}
public function __clone()
{
trigger_error('Clone is not allowed.', E_USER_ERROR);
}
public function __wakeup()
{
trigger_error('Unserializing is not allowed.', E_USER_ERROR);
}
|