[OWASP_PHPSEC] Namespace

Sven Rautenberg sven at rtbg.de
Sun Jul 28 10:21:36 UTC 2013


Yes, they do. Currently all your classes are in the same namespace, and
will interfere with each other if defined.

But this will only happen if the code has been included. Or is going to
be autoloaded... (see issue #29 why this cannot currently be used).

But even if autoloading would be implemented, you still cannot autoload
simple functions, only classes.

Regards,
Sven

Am 28.07.2013 12:10, schrieb rahul chaudhary:
> Hello All,
> 
> I have this weird doubt...basic doubt.
> 
> So two files that share a namespace, do they also share functions defined
> under that namespace ?
> 
> e.g.:
> time.php defines function time() in namespace phpsec
> 
> now in another file say testTime.php which is in same namespace, phpsec,
> can't I directly use this time function using \phpsec\time(). Do, I have to
> first use require_once("time.php") to call this function \phpsec\time()
> 
> 
> 
> _______________________________________________
> OWASP_PHP_Security_Project mailing list
> OWASP_PHP_Security_Project at lists.owasp.org
> https://lists.owasp.org/mailman/listinfo/owasp_php_security_project
> 



More information about the OWASP_PHP_Security_Project mailing list