What are some best practices for ensuring compatibility with different PHP versions when developing websites?

When developing websites, it is crucial to ensure compatibility with different PHP versions to avoid potential errors or issues. One best practice is to use PHP functions and syntax that are supported across a wide range of PHP versions. Additionally, regularly testing your website on different PHP versions can help identify and address any compatibility issues early on.

// Example of using a PHP function that is compatible with different PHP versions
if (function_exists('some_function')) {
    some_function();
}