Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

JsonSerializable should not call json_encode() in Emarref\Jwt\Token\PropertyList->jsonSerialize() #34

@Grundik

Description

@Grundik

Method jsonSerialize of JsonSerializable interface should return data to be serialized to json, not json itself, as stated in the PHP documentation: "JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON". Using json_encode in jsonSerialize() causes double json encoding: at first in jsonSerialize, and then json string is converted to json again by json_encode itself.

Problem exists in Emarref\Jwt\Token\PropertyList->jsonSerialize(): https://github.com/emarref/jwt/blob/master/src/Token/PropertyList.php#L43, it should just return $properties, not json_encode($properties).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions