What are the potential differences between using a *.inc.php file and a regular *.php file in PHP development?

When using a *.inc.php file in PHP development, it is typically meant to include reusable code snippets or functions that are not meant to be accessed directly by users. This is a common practice to organize code and prevent direct access to certain files. On the other hand, a regular *.php file can contain the main logic of the application and can be accessed directly by users.

// Example of using a *.inc.php file to include reusable code snippets or functions

// functions.inc.php
<?php
function calculateSum($num1, $num2) {
    return $num1 + $num2;
}

// main.php
<?php
include('functions.inc.php');

$result = calculateSum(5, 3);
echo $result; // Output: 8