3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class x{ public function __construct() { $params = ['foo']; $this->$params[0](); } public function foo() { echo 'oh, foo'; } } new x;
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/JkCjO on line 7 Notice: Undefined property: x::$Array in /in/JkCjO on line 7 Fatal error: Uncaught Error: Function name must be a string in /in/JkCjO:7 Stack trace: #0 /in/JkCjO(13): x->__construct() #1 {main} thrown in /in/JkCjO on line 7
Process exited with code 255.
Output for 5.4.10 - 5.6.28
oh, foo
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/JkCjO on line 6
Process exited with code 255.