If the $name constant doesn't exist in the targetted class the function returns bool(false), not empty nor null but false (you to test with "==="$constFounded = false ;$this->currentlangClass = new ReflectionClass($langFile);$this->currentlangClass->getConstant($constant);if($myConst !== false){ $constFounded = true ;}