Skip to content

Commit

Permalink
Use strpos instead of str_contains
Browse files Browse the repository at this point in the history
Fixes #7219 (str_contains was added in PHP 8)
  • Loading branch information
weirdan committed Dec 26, 2021
1 parent aea1cba commit 9387942
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -41,7 +41,6 @@
use function in_array;
use function mt_rand;
use function reset;
use function str_contains;
use function strpos;
use function substr;

Expand Down Expand Up @@ -505,7 +504,7 @@ public static function getReturnTypeFromMappingIds(
public static function cleanContext(Context $context, int $fake_var_discriminator): void
{
foreach ($context->vars_in_scope as $var_in_scope => $_) {
if (str_contains($var_in_scope, "__fake_{$fake_var_discriminator}_")) {
if (strpos($var_in_scope, "__fake_{$fake_var_discriminator}_") !== false) {
unset($context->vars_in_scope[$var_in_scope]);
}
}
Expand Down

0 comments on commit 9387942

Please sign in to comment.