public function getClassName() { try { return ($ref = parent::getClass()) ? $ref->getName() : NULL; } catch (\ReflectionException $e) { if (preg_match('#Class (.+) does not exist#', $e->getMessage(), $m)) { return $m[1]; } throw $e; } }