I get an error when I try to instantiate the following:
$main = new Main();
$main->run();
class Main
{
public function run() {
$instance = new C();
}
}
Error:
Fatal error: Class 'C' not found in /path/to/file/test.php on line xx
Everything needs to be in the same file, so I have the following setup for classes and interfaces:
interface A { ... }
abstract class B { ... }
class C extends B implements A { ... }
This order makes sense and I cannot figure out why it doesn't work. Also, the Main class is defined before interface A.