Search code examples
php-7.2php-5.4

PHP Upgrade from 5.4 to 7.2


I am upgrading the PHP version used for a project. Used PHP Code Sniffer to find possible issues with PHP 7.2. How to resolve the following issue ?

1) $this->mbstring_overload = ini_get('mbstring.func_overload') & 2;

INI directive 'mbstring.func_overload' is deprecated since PHP 7.2.

2) $s->service($HTTP_RAW_POST_DATA);

Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead

3) $this->asp_tags = (ini_get('asp_tags') != '0'); INI directive 'asp_tags' is removed since PHP 7.0. Since this is removed in PHP 7.0, what is the alternative for this?


Solution

  • 1) if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)){ $this->mbstring_overload = ini_get('mbstring.func_overload') & 2; }
    2) $s->service(file_get_contents("php://input"));