What is namespaces in PHP?

devquora
devquora

Posted On: Apr 15, 2024

 

    1 Answer Written

  •  devquora
    Answered by Prachi

    Namespace in PHP is an authentic way of encapsulating the elements so that the possibility to reuse the same names can be avoided and name conflicts can be prevented. They can be declared using namespace keyword and it affects a large number of codes including interfaces, elements, abstracts, classes, and functions. It also assists to remove the complications with library and applications for code elements reusability.

Related Questions

Please Login or Register to leave a response.

Related Questions

PHP Interview Questions

What is T_PAAMAYIM_NEKUDOTAYIM in PHP?

T_PAAMAYIM_NEKUDOTAYIM is scope resolution operator used as :: (double colon) .Basically, it used to call static methods/variables of a Class...

PHP Interview Questions

What is the difference between == and === operator in PHP ?

In PHP == is equal operator and returns TRUE if $a is equal to $b after type juggling and === is Identical operator and return TRUE if $a is equal to $b, and they are of the same data type...