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: 8 months 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);

For more information send a message to info at phpclasses dot org.