Skip to main content
gamedev.net
🔒 Locked

[web] php namespace?

Started by supagu Oct 10, 2006 at 4:24 AM 0 replies 700+ views
Original Post
supagu
supagu
is there some sort of namespace support in php like in c/c++? problem is i have a class called Template for my website, now im trying to integrate some forums and having issues with a class they have also called Template. I need to use both versions in the same file but cant as i get an error says its already defined.
Verminox
Verminox
PHP Namespaces could be included in PHP 6, but that's not going to be ready for a while. So at this moment, no there aren't any. You will probably have to rename the class if you have two with the same name.

The best thing to do to avoid this is to prefix each class name with some identifier just like a namespace would be.


If you are saying, "What? PHP doesn't have namespaces? That sucks!", then you may want to check this out.
--------------------------------------Amaze your friends! Astound your family! Kennify your text!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.