3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Teste{ public function t(){ echo 'teste'; } } $str =['Test']; $obj = new $str[0]; $obj->t();
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Class 'Test' not found in /in/jqQYj:9 Stack trace: #0 {main} thrown in /in/jqQYj on line 9
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Class 'Test' not found in /in/jqQYj on line 9
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/jqQYj on line 8
Process exited with code 255.