Vidyalelo
PHP · Q79

Object Oriented Concept

Programming · PHP · question 79

Q79

Which one of the following is the correct way of declaring a namespace?

A.
namespace my;
Answer
B.
namespace my();
C.
my namespace;
D.
namespace(my);

Answer: Option A

Solution

Answer: Option A
Solution:
The namespace declaration must be the first statement in its file.