This is an old revision of the document!

PHP RFC: IntlChar class


Abstract final classes are helpful in the case you are wrapping common functions that are static, but the common class itself cannot be instantiated. Currently, PHP developers' only resource is to create a final class with a private constructor, leading to untestable and error prone code.

For such, here is motivation:

  • As “abstract”, it cannot be instantiated
  • As “final”, it cannot be extended (such as visibility increase, behavior change, etc)
  • There's no way of adding variables to a namespace. This would address this issue too


Change language scanner to accept abstract final class constructor, and subsequently restricting to only static members.

Proposed PHP Version(s)



abstract final class StringUtil
    public static function isNotNullOrSpace($str)
        return !($str === null || strlen($str) < 1 || strlen(trim($str)) < 1);
echo StringUtil::isNotNullOrSpace('')
    ? 'Empty string'
    : 'Non-empty string';

Proposed Voting Choices

Good question… 2/3? or 50% + 1?


rfc/abstract_final_class.1417059771.txt.gz · Last modified: 2017/09/22 13:28 (external edit)