How can the issue of relative path vs absolute path be resolved when working with PHP and OOP?

When working with PHP and OOP, the issue of relative path vs absolute path can be resolved by using the `__DIR__` magic constant to get the absolute path of the current file. By combining `__DIR__` with the relative path, you can ensure that the correct file path is always used regardless of the current working directory.

// Resolve the issue of relative path vs absolute path in PHP OOP
class MyClass {
    public function includeFile($relativePath) {
        $absolutePath = __DIR__ . '/' . $relativePath;
        include $absolutePath;
    }
}

// Example usage
$myClass = new MyClass();
$myClass->includeFile('myFile.php');