I've got a namespaced file called test.php with a function and a class:
namespace Test;
function testFunc(){}
class TestClass{}
Then if, in another file I "use" both of these namespace elements, the class works but not the function:
use Test\testFunc,
Test\TestClass;
include "test.php";
new TestClass();
testFunc();
The TestClass object is created fine, but I get a fatal error for testFunc():
Fatal error: Call to undefined function testFunc()
I thought functions were supported with namespaces. What am I doing wrong?
EDIT: Explanation here - http://www.php.net/manual/en/language.namespaces.faq.php#language.namespaces.faq.nofuncconstantuse