Hey there,
just some background info needed for my learning curve …
Situation:
namespace Something;
use DeviceDetector\Parser\Device\DeviceParserAbstract;
// Some code ...
class Someclass {
protected function setVersionTruncation($version)
{
$string = strtoupper($version);
$constant = 'DeviceDetector\Parser\Device\DeviceParserAbstract::VERSION_TRUNCATION_' . $string;
if (defined($constant)) {
return DeviceParserAbstract::setVersionTruncation(constant($constant));
} else {
return false;
}
}
}
Question: Why does constant need the full namespace & (abstract) class DeviceParserAbstract while the return statement doesn’t?
Thank you very much.