Re: abstract functions

From: Date: Sat, 09 Nov 2002 10:51:19 +0000
Subject: Re: abstract functions
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-90701@lists.php.net to get a copy of this message
ZE1 way: class MyClass { function MyClass() { die('MyClass is an abstract class'); } } ZE2 way: class AbstractClassException { } class MyClass { function MyClass() { throw new AbstractClassException(); } } On Sat, 09 Nov 2002, Jens Rehsack wrote: > Hi, > > does PHP4 with the ZE2 supports abstract function like Delphi or C++? > That would be very useful for class development, cause we can avoid > testing if a class is abstract if an abstract class couldn't be > instantiated? > > Syntax could be like in C++ > class X > { > X(){} > int y() = 0; > } > > or little bit more like pascal > > class X > { > X(){} // PHP > function x(); abstract; > } > > or > > class X > { > X(){} // PHP > abstract function x(); > } > > Greetings, > Jens > -- > L i W W W i Jens Rehsack > L W W W > L i W W W W i nnn gggg LiWing IT-Services > L i W W W W i n n g g > LLLL i W W i n n g g Friesenstraße 2 > gggg 06112 Halle > g > g g > Tel.: +49 - 3 45 - 5 17 05 91 ggg e-Mail: <rehsack@liwing.de> > Fax: +49 - 3 45 - 5 17 05 92 http://www.liwing.de/ > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php -Andrei http://www.gravitonic.com/ * A feature is a bug with seniority. *

« previous php.dev (#90701) next »