rendered paste body<?phpclass A_Static_One { static private $singleton = null; public $options = array( 'test' => 'yes' ); public function instance($data=array()) { if (is_null(self::$singleton)) { self::$singleton = new self(); self::$singleton->options = array_merge(self::$singleton->options, (array) $data); } else { self::$singleton->options = array_merge(self::$singleton->options, (array) $data); return self::$singleton; } } private function __construct() { } public function get($key) { $o = self::instance(); if (isset($o->options[$key])) { return $o->options[$key]; } return false; } public function set($key, $value) { $o = self::instance(); $o->options[$key] = $value; return true; }}print A_Static_One::get('test')."\n";$o = A_Static_One::instance(array('a'=>'a1', 'b' => 'b2'));var_dump(A_Static_One::get('b'));var_dump($o->get('a'));A_Static_One::set('bite', 'couille');var_dump(A_Static_One::get('bite'));echo "\n";