Answers for "php calling abstract static function from inside abstrac class"

PHP
0

php calling abstract static function from inside abstrac class

abstract class AbstractFoo{
    public static function foo() {
        throw new RuntimeException("Unimplemented");
    }
    public static function getFoo(){
        return static::foo();
    }
}

class ConcreteFoo extends AbstractFoo{
    public static function foo(){
        return "bar";
    }
}

echo ConcreteFoo::getFoo();
Posted by: Guest on August-16-2021

Code answers related to "php calling abstract static function from inside abstrac class"

Browse Popular Code Answers by Language