3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public static function test() { echo __METHOD__; } } $bar = ['test']; Foo::{$bar[0]}(); (Foo::$bar)[0]();
based on K628n
Output for 7.0.0 - 7.2.0
Foo::test Fatal error: Uncaught Error: Access to undeclared static property: Foo::$bar in /in/B7qch:14 Stack trace: #0 {main} thrown in /in/B7qch on line 14
Process exited with code 255.
Output for 5.4.10 - 5.6.21
Parse error: syntax error, unexpected '[' in /in/B7qch on line 14
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/B7qch on line 11
Process exited with code 255.