Re: Simple Namespace Proposal

From: Date: Wed, 04 Jul 2007 19:14:17 +0000
Subject: Re: Simple Namespace Proposal
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-30449@lists.php.net to get a copy of this message
Does this mean that a project like Phorum could declare the same namespace at the top of all of our files and all the code in those files would exist in the same namespace?
Theoretically, yes, that's the idea. Practically there could be some problems with variable names - right now the patch does not resolve names, so if you do $name = "func", $name("foo"); it might not work, you'd need to use __NAMESPACE__ currently. I'm not sure how much of a trouble it is.
Or, would list.php have to import the Phorum namespace?
no, no import is necessary for same-namespace references.
Also, I don't see any mention of variables in namespaces. Will there be no effect on variables?
No namespace variables, right. For grouping variables you have arrays and classes, should be good enough ;) -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#30449) next »