Hey guys,
I'm trying to get the value of a constant of an extending class, but in a method of the abstract class. Like this:
abstract class Foo {
public function method() {
echo self::constant;
}
}
class Bar extends Foo {
const constant = "I am a constant";
}
$bar = new Bar();
$bar->method();
This however results in a fatal error. Is there any way to do this?