Skip to content

Commit 4f454bb

Browse files
Fix alerts text
1 parent 2ba8225 commit 4f454bb

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

bench.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function print_pre($msg) {
5959
error_reporting(E_ERROR | E_WARNING | E_PARSE);
6060

6161
// Check XDebug
62-
$xdebug = ini_get('xdebug.default_enable');
62+
$xdebug = (int)ini_get('xdebug.default_enable');
6363
if ($xdebug) {
6464
print_pre('<<< ERROR >>> You need to disable Xdebug extension! It greatly slow things down!'.PHP_EOL);
6565
exit(1);
@@ -68,22 +68,20 @@ function print_pre($msg) {
6868

6969
// Check OpCache
7070
if (php_sapi_name() != 'cli') {
71-
$opcache = ini_get('opcache.enable');
71+
$opcache = (int)ini_get('opcache.enable');
7272
if ($opcache) {
73-
print_pre('<<< ERROR >>> You need to disable OpCache extension! It may affect results greatly! Make it via .htaccess, VHost or fpm config'.PHP_EOL);
74-
exit(1);
73+
print_pre('<<< WARNING >>> You may need to disable OpCache extension! It may affect results greatly! Make it via .htaccess, VHost or fpm config'.PHP_EOL);
7574
}
7675
} else {
77-
$opcache = ini_get('opcache.enable_cli');
76+
$opcache = (int)ini_get('opcache.enable_cli');
7877
if ($opcache) {
79-
print_pre('<<< ERROR >>> You need to disable Cli OpCache extension! It may affect results greatly! Run php with param: -dopcache.enable_cli=0'.PHP_EOL);
80-
exit(1);
78+
print_pre('<<< WARNING >>> You may need to disable Cli OpCache extension! It may affect results greatly! Run php with param: -dopcache.enable_cli=0'.PHP_EOL);
8179
}
8280
}
8381

84-
$mbover = ini_get('mbstring.func_overload');
85-
if ($mbover == 2) {
86-
print_pre('<<< ERROR >>> You need to disable mbstring string functions overloading! It greatly slow things down! And messes with results.'.PHP_EOL);
82+
$mbover = (int)ini_get('mbstring.func_overload');
83+
if ($mbover != 0) {
84+
print_pre('<<< ERROR >>> You must disable mbstring string functions overloading! It greatly slow things down! And messes with results.'.PHP_EOL);
8785
exit(1);
8886
}
8987

0 commit comments

Comments
 (0)