Hi Mark,
On Wed, Mar 23, 2022 at 11:55 PM Mark Niebergall <[email protected]>
wrote:
> (...)
>
> Another example I often see in my projects could be used with a similar
> example:
>
> ```
> abstract class Bird
> {
> public const bool CAN_FLY;
> public const string FAMILY;
> public function canFly(): bool
> {
> return self::CAN_FLY;
> }
> }
> final class EmperorPenguin extends Bird
> {
> public const bool CAN_FLY = false;
> public const string FAMILY = 'penguin';
> }
> ```
>
I had this "need" too (and used abstract static methods where the
implementations just return a literal value...).
Just 2 remarks: in abstract class Bird, shouldn't it be:
- "*abstract* public const bool CAN_FLY;" (and same for FAMILY)
- "return *static*::CAN_FLY;"
?
Regards,
--
Guilliam Xavier