str_contains vs Symfony Polyfill / Php80 str_contains #33386
-
Description:str_contains helper method signature is diffrent then symfony / polyfill for php8 str_contains. It expects both $haystack and $needle to be string, passing array might couse to unexpected errors especially when a random vendor package requires the polyfill and your application does not. Solution:Match the function signature. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
str_contains was removed from the framework core a while ago. We don't recommend you use those functions anymore, but the package is provided for BC. |
Beta Was this translation helpful? Give feedback.
-
In one of my projects, I also had to deal with this. I ended up replacing str_contains calls with Str::contains |
Beta Was this translation helpful? Give feedback.
str_contains was removed from the framework core a while ago. We don't recommend you use those functions anymore, but the package is provided for BC.