Q:

How do we stop object creation by the user of class in PHP? 

I want to stop object creation by the user of class "OzoneRequest" and "OzoneResponse"in PHP .  Only one object is created  at OzoneApplication's constructor.  How I'll do this?  May be you understand my question 
I do not want creation of object by the user Only I create an object that only one object exist.  If user want to create object then this will not be performed... this will give an error...... 

A:

class OzoneRequest
{
 private static $instance = null;

 private function __construct() { }

 private function __clone() { }

 public static function getInstance()
 {
   if (! isset(self::$instance)) {
     self::$instance = new OzoneRequest();
   }
   return self::$instance;
 }

}

class OzoneApplication
{
  protected $req;

  public function __construct()
  {
    $this->req = OzoneRequest::getInstance();
  }

}

