Its a good practice to use feature detects instead of hardcoding certain version-checks or try to sniff the environment.
This can lead to dead code, e.g.
// prevent session locking trough other addons
if (function_exists('session_abort')) {
session_abort();
} else {
session_write_close();
}
This code is written like that because depending on the php-version the function in question might exists or not. In case it is missing we have implemented a less optimal alternative.
When upgrading the min-php version of the project this code might easily be dead, because the function will always exist.
Maybe there is some way to detect this kind of codes and report it as dead
Its a good practice to use feature detects instead of hardcoding certain version-checks or try to sniff the environment.
This can lead to dead code, e.g.
This code is written like that because depending on the php-version the function in question might exists or not. In case it is missing we have implemented a less optimal alternative.
When upgrading the min-php version of the project this code might easily be dead, because the function will always exist.
Maybe there is some way to detect this kind of codes and report it as dead