3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class ParentClass { public static function demo() { 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();
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
static::TABLE is child_const static::$table is child_var

preferences:
59.66 ms | 406 KiB | 5 Q