singleton

1 件の記事

2011

PHPでシングルトンパターン

継承元のクラスでこんなふうに書いたらだめだった。 継承先のクラスのオブジェクトをシングルトンで生成したかっただけなんですけどね。 <?php Abstract class Object { protected static $instance = null; protected function __clone() {…

Photo: Jaz. Mine / Unsplash LicensePhoto: Se. Tsuchiya / Unsplash LicensePhoto: Sergio / Unsplash LicensePhoto: Robert Bant / Unsplash LicensePhoto: Zhi Xuan Hew / Unsplash License