Skip to content

[php 8.3] Add json_validate rule #9150

Closed

Description

@TomasVotruba
$json = '{"key": "value"}';
-if (json_decode($json, true) !== null && json_last_error() === JSON_ERROR_NONE) {
+if (json_validate($json)) {
    echo "Valid JSON";
}

Activity

  1. samsonasik commented on May 19, 2025

    @samsonasik
    Member

    json_validate seems has flags parameter, the change seems documented at https://php.watch/versions/8.3/json_validate for the transformation needs.

  2. samsonasik commented on Sep 3, 2025

    @samsonasik
    Member
  3. samsonasik commented on Sep 4, 2025

    @samsonasik
    Member
  4. github-actions commented on Feb 8, 2026

    @github-actions
    Contributor

    This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.

  5. locked as resolved and limited conversation to collaborators on Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions