<?php
class Model {
public static function test()
{
echo "it works\n";
}
}
class ModelName {
public function getModelName() {
return 'Model';
}
}
$modelName = new ModelName;
${$modelName->getModelName()}::test();
Warning: 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 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Warning: 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.
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 7.3.32 - 7.3.33
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.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.