You’d like to use the class MyDBConnection that’s defined in the
MyGreatFrarnework\GreafDatabaseAbstractionLayer namespace, but you want to minimize *as
much as possible* the length of the class name you have to type. What would you do?
A.
Import the MyGreatFramework namespace
B.
Import the MyGreatFrarnework\GreafDatabaseAbstractionLayer namespace
C.
Alias MyGreatFrarnework\GreafDatabaseAbstractionLayer\MyDBConnection to a shorter name
D.
Alias MyGreatFrarnework\GreafDatabaseAbstractionLayer to a shorter name
Explanation:
This removes the need to prefix the class with the namespace name. You can refer
to the class simply as MyDBConnection.
The correct answer is C. As shown in https://secure.php.net/manual/en/language.namespaces.importing.php (Example with “Another” class)
0
0
Correct answer is B
0
0