PHPCompatibility Code



When any ini setting is removed, its value essentially becomes false, regardless of the data type that the directive used to contain. This means that you can hardcode it in statements. Some code may even become unreachable and can therefore be completely removed.


Clean up the affected code.

Example with code simplification

$apcEnabled = ini_get('apc.enabled');

If the directive was removed, it will always be false.

$apcEnabled = false;

Example with execution path cleanup

$path = $baseDir;

$safeModeExecDir = ini_get('safe_mode_exec_dir');
if (!empty($safeModeExecDir)) {
    $path .= PATH_SEPARATOR . $safeModeExecDir;

If $safeModeExecDir is always false, then the entire block is unreachable and can be removed.

$path = $baseDir;