PHP class_exists does not find a class which exists in the code

In my PHP code, I have a class MyClassV3.

In another part of the code, one is testing its existence:

$class = 'MyClass' . $version;
if (!class_exists($class)) {
    // ...error is thrown
}

In the logs, I get the thrown exception where $class = 'MyClassV3'. Is it a composer.json issue?

What could explain this?

Upvotes: 0

Views: 493

Answers (1)

Performing composer dump-autoload was the solution.

Upvotes: 1

Related Questions