phpjoomlaphp-8

Problem with upgrading php version from 7.4 to 8


I am using Joomla version 3.10 and after upgrading the php version from 7.4 to 8.0, I received this error.

Fatal error: Unparenthesized a ? b : c ? d : eis not supported. Use either(a ? b : c) ? d : eora ? b : (c ? d : e) in /home/public_html/language/fa-IR/fa-IR.localise.php on line 115

I put the source code of fa-IR.localise.php on line 115 below:

`if (strpos($return, self::MONTH_LENGTH) !== false) {
            $return = str_replace(self::MONTH_LENGTH, $m < 7 ? 31 : $m < 12 ? 30 : self::leap_persian($y) ? 30 : 29 , $return);`

Thank you for helping me.

When I go back to php version 7.4, the problem is solved


Solution

  • $return = str_replace(self::MONTH_LENGTH, ($m < 7 ? 31 : ($m < 12 ? 30 : (self::leap_persian($y) ? 30 : 29) ) ) , $return);
    

    Operations need after PHP 7.4 this ( ... ) brace's.