Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Fatal error: Cannot redeclare str_contains() (Read 23346 times) previous topic - next topic

Re: Fatal error: Cannot redeclare str_contains()

Reply #15
hello  swisscharles you need to comments line 524 {} after it will work

Thanks ayilmaz. Everything working now!
Does anybody know about any unwanted side effects when commenting said line out?


 

Re: Fatal error: Cannot redeclare str_contains()

Reply #16
There is a new function in PHP 8 with the name str_contains.
here you can see https://php.watch/versions/8.0/str_contains
for this reason, it shows the error, just rename it something "my_str_contains"



Re: Fatal error: Cannot redeclare str_contains()

Reply #19
function str_contains($needle, $haystack)
{
      return strpos($haystack, $needle) !== false;
}

Change this code

error_reporting(0);
if (strpos($haystack, $needle) !== false) {
  echo '';
}

Re: Fatal error: Cannot redeclare str_contains()

Reply #20
YES Same issue was here today and commenting that peice of code solved the issue ..
Thank You So Much Twolsey
 
For now, I have commented out the code and it seems to work for the time being, but definitely need a fix long term.