Home  >  Article  >  Backend Development  >  请问一个类的设计有关问题

请问一个类的设计有关问题

WBOY
WBOYOriginal
2016-06-13 10:04:21862browse

请教一个类的设计问题
我定一了一个父类 Catching
然后又定义了几个实现功能的类,每一个功能类 A() B() C() 都include了Catching类所在的文件并继承了
A extend Catching ………………

然后为了实现功能index.php 我需要用到 A B C 类

我就分别include引入了 A B C 类所在的文件。

现在我一运行,就提示有错误,说 Catching 从复定义
Cannot redeclare class Catching


还请高手指点一下,我那里设计错误了。



------解决方案--------------------
include_once

已加载就不加载

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn