The manual entry for constant() says that if the constant is not defined the function should return NULL. In the case of the code below, however, it gives a fatal error.
$constant = get_class($this) . '::' . $name;
$value = constant($constant);
If $name is valid, things work fine. If it’s not, however, I get a fatal error “Undefined class constant …” The manual says it should raise an E_WARNING error too but I’m not seeing this in the log file.
Your PHP setup may be setup to treat all errors as fatal errors. If that is the case, checking to see if the constant exists before you try to retrieve it will be a fix: