What version of PHP was recommended to be used to avoid the issue with magic_quotes_gpc?

The issue with magic_quotes_gpc is that it automatically adds backslashes to incoming data, which can lead to double escaping and other problems. To solve this issue, it is recommended to disable magic_quotes_gpc in PHP settings or upgrade to a version of PHP where this feature is deprecated, such as PHP 5.4 or higher.

// Disable magic_quotes_gpc
if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value) {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
    }

    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
    $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}