3v4l.org

run code in 300+ PHP versions simultaneously
<?php class other{ public static function foo(){echo "bingo";} } class my_class { protected static $class_name = "other"; public function method() { self::$class_name::foo(); } } new my_class()->method();
Output for 8.4.1 - 8.4.7
bingo
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.21
Parse error: syntax error, unexpected token "->" in /in/t2Tnt on line 14
Process exited with code 255.

preferences:
180.16 ms | 1009 KiB | 7 Q