3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function fun() { echo "fooo"; } } $parts = ['Foo', 'fun']; (new $parts[0])->$parts[1]();
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/pd0PP on line 11 Notice: Undefined property: Foo::$Array in /in/pd0PP on line 11 Fatal error: Uncaught Error: Function name must be a string in /in/pd0PP:11 Stack trace: #0 {main} thrown in /in/pd0PP on line 11
Process exited with code 255.
Output for 5.4.1 - 5.6.28
fooo
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/pd0PP on line 9
Process exited with code 255.