3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { static function hello(){ echo "Hello World\n"; } } $y[0] = 'hello'; echo "{A::${y[0]}()}"; echo A::${y[0]}();
based on qifcC
Output for 7.2.0
{A::hello()} Warning: Use of undefined constant y - assumed 'y' (this will throw an Error in a future version of PHP) in /in/4oqa6 on line 12 Fatal error: Uncaught Error: Function name must be a string in /in/4oqa6:12 Stack trace: #0 {main} thrown in /in/4oqa6 on line 12
Process exited with code 255.
Output for 7.0.0 - 7.1.10
{A::hello()} Notice: Use of undefined constant y - assumed 'y' in /in/4oqa6 on line 12 Fatal error: Uncaught Error: Function name must be a string in /in/4oqa6:12 Stack trace: #0 {main} thrown in /in/4oqa6 on line 12
Process exited with code 255.
Output for 5.6.8 - 5.6.28
{A::hello()} Notice: Use of undefined constant y - assumed 'y' in /in/4oqa6 on line 12 Fatal error: Function name must be a string in /in/4oqa6 on line 12
Process exited with code 255.
Output for 5.3.21 - 5.5.35
Parse error: syntax error, unexpected '[' in /in/4oqa6 on line 12
Process exited with code 255.