I am working on something, just practicing and I don't have that much experience. I am using namespaces and I have one functions in class namespaced under 'App\Core' which should include another file with different class and namespaced under 'App\Diff' and return that new class. i.e.
namespace App\Core; class Test { public function testFunc($file) { require_once "../folder/" . $file . ".php"; return new $file(); } } now class inside $file
namespace App\Diff; class Test2 { } I tried something like return
new App\Diff . "\{$file()}"; but I got an error "Class App\Code\App\Diff not found ..."
new \App\Diff?Testclass and call thetestFunc()?use App\Core\Test;and call it from within a functionpublic function function callTest() { $a = $this->b->testFunc('ClassName'); }and b is an instance of Test class