downloads | documentation | faq | getting help | mailing lists | reporting bugs | sites | links | my 
search for in the  
<Object ConstantsObject Interfaces>
Last updated: Mon, 16 Jul 2012


PHP 5 中引入了抽象类及方法的概念。 An abstract method only declares the method's signature and does not provide an implementation. A class that contains abstract methods needs to be declared abstract.

例子 19-6. 抽象类代码实例

abstract class AbstractClass {
   abstract public function

ImplementedClass extends AbstractClass {
   public function
test() {
"ImplementedClass::test() called.\n";

$o = new ImplementedClass;

抽象类不能被实例化。Old code that has no user-defined classes or functions named 'abstract' should run without modifications.

<Object ConstantsObject Interfaces>
 Last updated: Mon, 16 Jul 2012
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at:
Last updated: Thu Jul 7 19:13:47 2005 CST