Search code examples
fuelphp

FuelPHP - Why is there a backslash in this code: $email = \Email::forge();


Why is there a backslash in this code?

$email = \Email::forge();

I am reading over the Email package documentation on FuelPHPs site. The above code is their example. Why is there a backslash?


Solution

  • Because the class is declared in global namespace and seems to be used in some other namespace, where it's required.

    Here's complete manual about namespaces: http://www.php.net/manual/en/language.namespaces.php