namespaces?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
afeick
Forum Newbie
Posts: 1
Joined: Fri Aug 09, 2002 12:50 pm

namespaces?

Post by afeick »

Does PHP have such a thing as namespaces? I found this article from Zend. It's pretty old (over a year), and there's really no other info.

My guess is that the answer will be no... So how do you avoid collision of names? Is there a good naming convention? Should I just write code with horribly obfucated names? :wink:

-Tony
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

...

Post by Takuma »

Not that I know of....
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

If you are refering to the naming of variables and functions then there are recommended ways of doing it, it is often suggested that for functions with more than one word names eg checkuserisadmin() you should capitalise the first letter of each word except the first, like this: checkUserIsAdmin() this makes it easier to read and see errors. Similarly with variables clear names should be given but I think they should not be too long, for example $x is not a good variable unless it is an x co-ordinate in a graph or actually means something in itself. Is this what you meant?
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

I believe namespaces is something that may be included in PHP5, but I've been wrong before.

Anyways, I like to use underscores, but I'm also one of the few PHP proggers that uses the "#" style of comments. I hope they never get rid of it or a lot of my stuff is going to come to a screeching halt. 8O

Later on,
BDKR
Post Reply