Re: [RFC] Abstract final classes

From: Date: Thu, 27 Nov 2014 10:35:10 +0000
Subject: Re: [RFC] Abstract final classes
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-79219@lists.php.net to get a copy of this message
2014-11-27 4:47 GMT+01:00 guilhermeblanco@gmail.com < guilhermeblanco@gmail.com>: > Hi, > > I worked on an implementation of a somehow controversial concept that > exists in hack and C#: abstract final classes. > > https://wiki.php.net/rfc/abstract_final_class > > My motivation is to further expand class support to add modifiers (PPP - > public, protected, private). I added this change to initially segregate > grammar rules. It was an easy feature without extensive complexity and > covers some use-cases. > > "Abstract final" is a strange way to name it. What you want is a "static" class: * The fact that one cannot initialise an abstract class is only a side effect. Abstract classes are meant to be used for inheritance. * Abstract static methods are not possible (one more reason why abstract is a bad name). * A "static" class does not have to be final, given the fact that PHP is one of the few languages that offer a robust Late Static Binding. Lazare INEPOLOGLOU Ingénieur Logiciel

« previous php.internals (#79219) next »