我正在学习 OOP 技术,所以如果我的问题听起来太基本,请不要太苛刻 ^_^ 我有 4 个 php 文件。
index.php
parentClass.php
childClass1.php
childClass2.php
childClass1.php 和 childClass2.php 基本上扩展了 parentClass.php。所以我的问题是,如果我在索引文件中包含或需要两个子类,index.php 文件是否会调用 parentClass 两次?例如:
require_once("childClass1.php");
$child1 = new childClass1();
require_once("childClass2.php");
$child2 = new childClass2();