How is it possible to create an object from the following string:
$object = 'User::class';
Normaly you would remove the quotes but its an dynamic call for example
$value = 'User::CONST_NAME_HERE'
function test($value, $delimiter = '::')
{
list($class, $constant) = explode($delimiter, $value);
$class = sprintf('%s::class', $class); // not working
}
What i'm trying to reach is create a simple function where you could give the classname and the const to get its value.