<?php class ParentClass { // whether it's abstract or not makes no difference public const TABLE = 'fallback_const_if_wanted'; public static string $table = 'fallback_var_if_wanted'; public static function demo() { echo 'self::TABLE is ', self::TABLE, "\n"; echo 'self::$table is ', self::$table, "\n"; echo 'static::TABLE is ', static::TABLE, "\n"; echo 'static::$table is ', static::$table, "\n"; } } class ChildClass extends ParentClass { public const TABLE = 'child_const'; public static string $table = 'child_var'; } ChildClass::demo();
You have javascript disabled. You will not be able to edit any code.