_info = 'Original value'; } function getInfo() { return $this->_info; } function setInfo($info) { $this->_info = $info; } function &getInstance() { static $instance = null; if (is_null($instance)) { $instance = new Singleton(); } return $instance; } } $a = & Singleton::getInstance(); $b = & Singleton::getInstance(); $a->setInfo('Hi, my name is A'); $b->setInfo('Hi, my name is B'); echo $a->getInfo() . "\n"; echo $b->getInfo() . "\n"; ?>