Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个 php 文件: main.class.php form.class.php
在这些文件中,有两个与其文件名同名的类,并且类形式从主类扩展主类有一个构造函数如何为类形式设置构造函数方法?
class Main { private $foo; public function __construct($foo) { $this->foo = $foo; } } class Form extends Main { private $bar; public function __construct($foo, $bar) { parent::__construct($foo); $this->bar = $bar; } }