PHP Classes

File: singleton.php

Recommend this page to a friend!
  Classes of Malik Naik   PHP Design Patterns Repository   singleton.php   Download  
File: singleton.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Design Patterns Repository
Implementation of common design patterns in PHP
Author: By
Last change:
Date: 2 years ago
Size: 225 bytes
 

Contents

Class file image Download
<?php

require_once 'vendor/autoload.php';

use
DesignPattern\Singleton\Singleton;

$s1 = Singleton::getInstance();
$s2 = Singleton::getInstance();

print
$s1->getMessage($s1, $s2) . "<br/>";
print
$s2->getMessage($s1, $s2);