"; } public function connect() { } public function exec() { } } class PostgreDB implements DB { public function __construct() { echo "Postgre db"; } public function connect() { } public function exec() { } } class MssqlDB implements DB { public function __construct() { echo"mssql db"; } public function connect() { } public function exec() { } } $oMysql= DBFactory::create("Mysql"); $oPostgre= DBFactory::create("Postgre"); $oMssql= DBFactory::create("Mssql");