Silence “Declaration … should be compatible” warnings in PHP 7
1. Workaround Since it is not always possible to correct all the code you did not write, especially the legacy one… if (PHP_MAJOR_VERSION >= 7) { set_error_handler(function ($errno, $errstr) { return strpos($errstr, ‘Declaration of’) === 0; }, E_WARNING); } This error handler returns true for warnings beginning with Declaration of which basically tells PHP that … Read more