What are some alternative methods to determine if a variable contains an integer value in PHP, considering different PHP versions and configurations?

When determining if a variable contains an integer value in PHP, one common method is to use the `is_int()` function. However, this function may not work as expected in some cases, especially when dealing with variables that have been dynamically typed. An alternative method is to use the `filter_var()` function with the `FILTER_VALIDATE_INT` filter, which can reliably check if a variable contains an integer value across different PHP versions and configurations.

$var = '123';

if (filter_var($var, FILTER_VALIDATE_INT) !== false || filter_var($var, FILTER_VALIDATE_INT) === 0) {
    echo "The variable contains an integer value.";
} else {
    echo "The variable does not contain an integer value.";
}