PHP中的接口

WBOY
WBOYOriginal
2016-06-23 14:31:44849browse

php与C#一样不支持多重继承,但可以用接口来实现多重继承的功能.

接口:接口的思想是指定一个实现了该接口的类必须实现接口中定义的一系列函数.接口定义了一组行为规范.

1)使用implements关键字实现接口,跟Objective-c一样.


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
Previous article:php.ini详解(转)Next article:php 构造方法