I am stumped - please help!
Posted: Mon Sep 20, 2010 7:11 pm
I am stumped as to why this simple code will not work...anyone care to enlighten me?
Running that code gives me this error:
Fatal error: Class 'testClass' not found in test.php on line 11
If I remove the namespace declaration it works fine...anyone?
Code: Select all
<?
namespace test;
class testClass {
function go() {
echo "hello world";
}
}
$x='testClass';
$t = new $x();
$t->go();
?>
Fatal error: Class 'testClass' not found in test.php on line 11
If I remove the namespace declaration it works fine...anyone?