diff --git a/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php b/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php index 95e3e0c60e1..f719968e5f1 100644 --- a/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php +++ b/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php @@ -380,17 +380,22 @@ private function getAllCompilerOptimizedFunctionsNormalized(): array 'is_object', 'is_real', 'is_resource', + 'is_scalar', 'is_string', 'ord', + 'sizeof', 'strlen', 'strval', // @see https://github.com/php/php-src/blob/php-7.2.6/ext/opcache/Optimizer/pass1_5.c + // @see https://github.com/php/php-src/blob/PHP-8.1.2/Zend/Optimizer/block_pass.c + // @see https://github.com/php/php-src/blob/php-8.1.3/Zend/Optimizer/zend_optimizer.c 'constant', 'define', 'dirname', 'extension_loaded', 'function_exists', 'is_callable', + 'ini_get', ]); } diff --git a/tests/Fixer/PhpTag/NoClosingTagFixerTest.php b/tests/Fixer/PhpTag/NoClosingTagFixerTest.php index 97113cf856e..ce86849d7e5 100644 --- a/tests/Fixer/PhpTag/NoClosingTagFixerTest.php +++ b/tests/Fixer/PhpTag/NoClosingTagFixerTest.php @@ -36,7 +36,7 @@ public function testWithFullOpenTag(string $expected, ?string $input = null): vo */ public function testWithShortOpenTag(string $expected, ?string $input = null): void { - if (!ini_get('short_open_tag')) { + if (!\ini_get('short_open_tag')) { static::markTestSkipped('The short_open_tag option is required to be enabled.'); } diff --git a/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php b/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php index 6a0baba348e..83e4bb4ce03 100644 --- a/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php +++ b/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php @@ -521,7 +521,7 @@ public function log($msg) */ public function testCasesWithShortOpenTag(string $expected, ?string $input = null): void { - if (!ini_get('short_open_tag')) { + if (!\ini_get('short_open_tag')) { static::markTestSkipped('No short tag tests possible.'); } diff --git a/tests/Fixer/Semicolon/SemicolonAfterInstructionFixerTest.php b/tests/Fixer/Semicolon/SemicolonAfterInstructionFixerTest.php index a5d8691c11e..8005be0ff4c 100644 --- a/tests/Fixer/Semicolon/SemicolonAfterInstructionFixerTest.php +++ b/tests/Fixer/Semicolon/SemicolonAfterInstructionFixerTest.php @@ -101,7 +101,7 @@ public function provideFixPre80Cases(): \Generator public function testOpenWithEcho(): void { - if (!ini_get('short_open_tag')) { + if (!\ini_get('short_open_tag')) { static::markTestSkipped('The short_open_tag option is required to be enabled.'); } diff --git a/tests/Tokenizer/TokensTest.php b/tests/Tokenizer/TokensTest.php index 330a84440a8..6c9237ce006 100644 --- a/tests/Tokenizer/TokensTest.php +++ b/tests/Tokenizer/TokensTest.php @@ -375,8 +375,8 @@ public function provideMonolithicPhpDetectionCases(): iterable yield [false, 'Hello']; yield [false, ' World!']; // short open tag - yield [(bool) ini_get('short_open_tag'), ""]; + yield [(bool) \ini_get('short_open_tag'), ""]; yield [false, " "]; yield [false, "