vikaspa Posted December 25, 2022 Share Posted December 25, 2022 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 } Quote Link to comment https://forums.phpfreaks.com/topic/315726-ned-help-to-understand-this-code/ Share on other sites More sharing options...
benanamen Posted December 25, 2022 Share Posted December 25, 2022 The whole thing should not even be in your code at all. Error reporting setting should be set in php.ini Quote Link to comment https://forums.phpfreaks.com/topic/315726-ned-help-to-understand-this-code/#findComment-1603877 Share on other sites More sharing options...
vikaspa Posted December 29, 2022 Author Share Posted December 29, 2022 thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/315726-ned-help-to-understand-this-code/#findComment-1603998 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.