Miscellany
public php v1 · immutable<?phpclass Singleton{ function &getInstance() //PHP4 style Singleton reference { static $_instance; if (!isset($_instance[$className])) $_instance[$className] = new $className; return $_instance[$className]; }}class foo extends Singleton { function &getInstance() { return parent::getInstance(__CLASS__); }}$obj = foo::getInstance();?>