What is the significance of using __DIR__ when including files in PHP?

Using __DIR__ when including files in PHP ensures that the file path is always relative to the current file's directory, regardless of where the script is being executed from. This helps prevent issues with file inclusion paths and makes the code more portable and easier to maintain.

include __DIR__ . '/path/to/file.php';