<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Latest snippets tagged singleton php pattern</title>
  <link rel="alternate" href="http://snippets.prendreuncafe.com/snippets/tagged/singleton+php+pattern/order_by/date"></link>
  <id>http://snippets.prendreuncafe.com/snippets/tagged/singleton+php+pattern/order_by/date</id>
  <updated>2006-10-11T16:28:17Z</updated>
  <author>
    <name>Symfony</name>
    <author_email>noreply@symfony-project.com</author_email>
  </author>
<entry>
  <title>Singleton en PHP5</title>
  <link href="http://snippets.prendreuncafe.com/snippet/3"></link>
  <updated>2006-10-11T16:28:17Z</updated>
  <id>3</id>
  <summary type="html">Instance unique d'un objet.

[code]
&lt;?php 
class Singleton 
{ 
    private static $_instance ; 
 
    private function __construct() { }
     
    public static function GetInstance() 
    { 
        if (!isset(self::$_instance)) 
        { 
            self::$_instance = new Singleton() ; 
        } 
        return self::$_instance; 
    }
}
?&gt;
[/code]</summary>
</entry>
</feed>