Skip to content

Deprecate the json_encode and json_decode functions #437

@soullivaneuh

Description

@soullivaneuh

Summary

Since PHP 7.3.0, the json_encode and json_decode functions have a JSON_THROW_ON_ERROR to be set in order to throw an exception instead of returning false in case of error.

Also, Rector proposes to automatically adding it trough the official PHP upgrade migration rules.

Is is still interesting to maintain those function inside this project? If not, we may mark them as deprecated. Also, we should update the provided rector migration file accordingly:

safe/rector-migrate.php

Lines 461 to 462 in 3a6e43b

'json_decode' => 'Safe\json_decode',
'json_encode' => 'Safe\json_encode',

Any though?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions