3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for git.master, git.master_jit, rfc.property-hooks
self::TABLE is fallback_const_if_wanted self::$table is fallback_var_if_wanted static::TABLE is child_const static::$table is child_var

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.72 ms | 405 KiB | 5 Q