Dear Sir
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
I want to know whether this code DONOT ALLOW execution in case PHP verson is > 5.3 and above
complete code
switch (ENVIRONMENT)
{
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;
case 'testing':
case 'production':
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break;
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR
}
whether this code will be executed in case php version is 7.4
Moderator: General Moderators
-
info@prajaktasoftware.com
- Forum Newbie
- Posts: 2
- Joined: Tue May 05, 2020 12:10 am
Re: whether this code will be executed in case php version is 7.4
No this code does not prevent the execution of the script if the PHP version is greater than or equal to 5.3. It simply sets the level of error reporting based on the version of PHP being used and the value of the ENVIRONMENT constant.