Warning: The use statement with non-compound name 'testClasses' has no effect in C:\wamp\www\demo02\index.php on line 2
This is namespace testing
Fatal error: Class 'testClasses\Test' not found in C:\wamp\www\demo02\index.php on line 6
Prema ovom bug report-u trebalo bi da radi, a ne verujem da ima neka sintaksna greska. Ima li neko ideju?
Test.php
namespace testClasses;
class Test {
function __construct() {
echo "Test class constructor from testClasses namespace!";
}
function getName($name)
{
return $name . " new user!";
}
}
index.php
use testClasses;
echo "<h1>This is namespace testing</h1> <br/>";
$t1 = new testClasses\Test();
$t1->getName("vlada");