3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class TT { abstract public static function xd(); } class Test { public const OK = 0; public const IS_PUBLIC = 1 << 0; public const IS_ABSTRACT = 1 << 1; protected const ASD = 23; private static int $field = 5; public static function &getSomeProperty() { return self::$field; } } $a =& Test::getSomeProperty(); if ($a === 5) { $a = 2; } var_dump(Test::getSomeProperty()); // 2 $test = new Test(); var_dump(Test::OK); var_dump(Test::IS_PUBLIC);
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.6
int(2) int(0) int(1)

preferences:
53.91 ms | 708 KiB | 4 Q