• Hi ,

    In my WP site (6.4.0) , after the upgrade of PHP 8.2 from 7.4, i am seeing deprecated errors/notices when enable the debug mode.

    Below are some samples,

    [05-Jan-2024 09:25:01 UTC] PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /code/wp-content/themes/****/vendor/illuminate/container/Container.php on line 900
    [05-Jan-2024 09:25:01 UTC] PHP Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /code/wp-includes/functions.php on line 4593
    [05-Jan-2024 09:25:01 UTC] PHP Notice: Error when decoding a JSON file at path /code/wp-content/themes/****/resources: Syntax error in /code/wp-includes/functions.php on line 4601

    [05-Jan-2024 13:23:06 UTC] PHP Deprecated: Return type of Illuminate\Config\Repository::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /code/wp-content/themes/****/vendor/illuminate/config/Repository.php on line 164
    [05-Jan-2024 13:23:06 UTC] PHP Deprecated: Return type of Illuminate\Config\Repository::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /code/wp-content/themes/****/vendor/illuminate/config/Repository.php on line 175

    Should i avoid these errors by disable debug mode ? or need to fix it?

    kindly answer.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    The issue is in your theme. You should contact the theme’s developers. (Why did you *** out the theme name?)

    Thread Starter hemasusi

    (@hemasusi)

    No, its not in my theme..

    We are using custom theme , theme folder name is our project name. Thats why hided that name with ***.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    The coding deprecation issues are in your theme.

    “Should i avoid these errors by disable debug mode ? or need to fix it?”

    You can ignore them for now by disabling debug, but eventually, you’ll have to fix it.

    Thread Starter hemasusi

    (@hemasusi)

    Then what about below error, its showing in wp-includes/functions.php

    [05-Jan-2024 09:25:01 UTC] PHP Notice: Error when decoding a JSON file at path /code/wp-content/themes/****/resources: Syntax error in /code/wp-includes/functions.php on line 4601

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    WP core is compatible with 8.2. You need to look at how you call a function in your theme. I note that you say you’re on 6.4.0. Update WP to the current version first. Maybe there was a bug fix in the last couple of point releases relevant to this.

    Moderator bcworkz

    (@bcworkz)

    The error in functions.php is because passing your theme’s JSON file to json_decode() resulted in an error. json_decode() is a native PHP function, not a WP function. If json_decode() cannot correctly parse your JSON file, it’s still an issue with your theme, not functions.php.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Deprecated Errors & Notices in PHP 8.2’ is closed to new replies.