Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13067 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69702 invoked by uid 1010); 29 Sep 2004 11:51:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 69641 invoked from network); 29 Sep 2004 11:51:04 -0000 Received: from unknown (HELO student.gvsu.edu) (148.61.7.113) by pb1.pair.com with SMTP; 29 Sep 2004 11:51:04 -0000 Received: from [192.168.1.101] FARRELJA [148.61.220.169] by student.gvsu.edu with NetMail SMTP Agent $Revision: 1.1.1.1 $ on Novell NetWare; Wed, 29 Sep 2004 07:51:01 -0400 Message-ID: <415AA1C8.3050300@student.gvsu.edu> Date: Wed, 29 Sep 2004 07:51:36 -0400 User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Virnstein CC: internals@lists.php.net References: <20040928124540.618.qmail@pb1.pair.com> <20040928134447.62577.qmail@pb1.pair.com> <1724849455.20040928233204@marcus-boerger.de> <20040929094434.37880.qmail@pb1.pair.com> In-Reply-To: <20040929094434.37880.qmail@pb1.pair.com> Content-Type: multipart/alternative; boundary="------------080302050702050107080307" Subject: Re: [PHP-DEV] Re: declaring classes as static or final From: farrelja@student.gvsu.edu (Jason Farrell) --------------080302050702050107080307 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Michael Virnstein wrote: >>>2. final classes: >>>final classes can't be extended >>> >>> >>already supported >> >> > >Cannot find it in the docs. >http://www.php.net/manual/en/language.oop5.final.php doesn't seem to have >any comments on that. >I'm not at home at the moment, so i couldn't try, but are you really sure >that final CLASSES are supported? >You're not confusing it with final METHODS, right? > > > > >>abstract static methods are already supported >> >> > >never said php doesn't support it, i just wanted to give some more input on >the rules that would fit for my suggestions. > > > >>>5. abstract classes can't be defined final >>> >>> >>already supported >> >> > >same as above > > > >>static classes would be implementable at the cost of increasing compiler >> >> >time. > > >>To decide whether to think more about it we'd to know a case where you >> >> >need > > >>such syntax, what you win by having it and what you loose if you don't >> >> >have > > >>it. >> >> > >A good example for a static class imo, would be e.g. PEAR's DB Class. The >DB-Class itself doesn't need to be instantiate, >it simply works as factory and has some functions to check stuff. that'd be >a class that i would define as >"final static class DB {}". The class should not be extended and should not >containt non static methods or attributes. Sure it isn't >a big deal, if ppl are instantiating the DB Class, but it only has static >methods and instantiating it wouldn't make any sense. > >Regards, Michael > > > Please see: http://www.php.net/zend-engine-2.php This will explain all the new OOP features in PHP5 Regards, Jason --------------080302050702050107080307--