inicio
foro
programas
bt-links
webmasters
midis
tutoriales
      Agregar a Favoritos | Libro de Visitas | Página de Inicio
Buscar:  En powered by Google
175 programas, 1578 usuarios, 1210 mensajes en el foro, 214 BT-Links
Villavicastur > Webmasters > Manual de PHP > Namespaces

Contenido

Namespaces

Table of Contents

Namespaces overview

Namespaces in PHP are designed to solve scoping problem in large PHP libraries. In PHP, all class definitions are global. Thus, when a library author creates various utility or public API classes for the library, he must be aware of the possibility that other libraries with similar functionality would exist and thus choose unique names so that these libraries could be used together. Usually it is solved by prefixing the class names with an unique string - e.g., database classes would have prefix My_Library_DB, etc. As the library grows, prefixes add up, leading to the very long names.

The namespaces allow the developer to manage naming scopes without using the long names each time the class is referred to, and solve the problem of shared globals space without making code unreadable.

Namespaces are available in PHP as of PHP 5.3.0. This section is experimental and subject to changes.


Conéctate
Usuario:

Contraseña:



Nuevo Usuario
Contraseña Perdida

Últimos Usuarios
· santiagohj
· sopas
· secc24
· mavf1983
· polland

Publicidad

Afiliados
 

 


[ Contacto · Agradecimientos · Política de Privacidad · Staff ]
© 2004-05 VillavicAstur Networks.
Al descargar y/o utilizar cualquier software y/o servicio te comprometes a cumplir con la Política de Privacidad.