This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FactoryMain | |
{ | |
private $type; | |
function __construct($type) | |
{ | |
$this->type = $type; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class ASingleTon{ | |
private static $counter = 0; | |
private static $instance = null; | |
public static function getInstance(){ | |
if(!empty(ASingleTon::$instance)){ | |
return ASingleTon::$instance; | |
} | |
ASingleTon::$instance = new ASingleTon(); | |
return ASingleTon::$instance; |