I am working on a personal project and it is the first time for me using OOP. My project has a base class, which is extended by others (basic setup). To clarify, this is what I am doing:

Base class:

```
class ABC {
  function __construct() {
    ...
  }
}

```

Extending class:

```
class DEF extends ABC {
  function __construct() {
    ...
  }
}

```

While the base class is always loaded, the other classes are loaded depending of the situation.

My question is, what is the proper way to dynamically load the right extended class? Should I 'import' both php? Should I cast the base class (*$x = new ABC()*), and then load the other class from the base class?