<?php class Db { public function __construct() { new PDO ( $dsn, $username, $passwd, $options ); } } class A extends Db{ } class B extends Db{ } new A(); new B();
初始化多个子类的时如何初始化1个父类
时间: 2024-12-10 13:51:07
<?php class Db { public function __construct() { new PDO ( $dsn, $username, $passwd, $options ); } } class A extends Db{ } class B extends Db{ } new A(); new B();
初始化多个子类的时如何初始化1个父类