In a string backslashes escape a character, if you need a backslash in a string you have to escape the backslash itself using another one. $this->objectManager->get('Vendor\\Package\\Class');