3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Model { public static function test() { echo "it works\n"; } } class ModelName { public function getModelName() { return 'Model'; } } $modelName = new ModelName; ${$modelName->getModelName()}::test();
based on sdBss
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: Model in /in/t7dpg on line 14 Fatal error: Uncaught Error: Class name must be a valid object or a string in /in/t7dpg:14 Stack trace: #0 {main} thrown in /in/t7dpg on line 14
Process exited with code 255.
Output for 5.3.20 - 5.6.21
Notice: Undefined variable: Model in /in/t7dpg on line 14 Fatal error: Class name must be a valid object or a string in /in/t7dpg on line 14
Process exited with code 255.