Unlock this challenge:
Check out this Koala class:
Koala
namespace Animal\Adorable; class Koala { }
And this code that uses it:
$koala = new \Animal\Adorable\Koala();
Is that first slash in \Animal\Adorable\Koala necessary?
\Animal\Adorable\Koala
Yes. If you choose to not have a use statement, then you must always start with a \ so that PHP knows to build the namespace from the root of all namespaces.
use
\
No. The slash is always optional, and really redundant: PHP knows that you are looking for a class from the root of the namespace.
It depends on whether or not this file lives in a namespace.