Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Phase out Serializable #41094

Copy link
Copy link
Closed
Closed
Copy link
@derrabus

Description

@derrabus
Issue body actions

Description
Due to its broken behavior, PHP is phasing out the Serializable interface currently.

See:

The replacement are the magic methods __serialize() and __unserialize() that have been introduced with PHP 7.4. As long as our implementations of Serializable also implement those methods, PHP 8.1 won't throw deprecation notices at us. As far as I can tell, we're safe here.

For Symfony 6, we decided to not provide support for PHP 7 anymore. This also means that we don't need Serializable as a BC layer for PHP 7.3 and below anymore. Because of that, I'd like to propose to remove that interface from all Symfony classes in 6.0.

Affected by this change:

  • Mime: RawMessage (the implementation of the interface is finalized and flagged @internal)
  • Routing: CompiledRoute and Route both implement the interface with @internal and final.
  • Security Core:
    • TokenInterface extends Serializable but also requires __serialize() and __unserialize() to be implemented.
    • AbstractToken provides an implementation that is again @internal and final.
    • NullToken implements Serializable without @internal and final.

Question now is: Do we need any additional deprecation layer for 5.4 or would it be okay to simply unannounce the interface and remove the implementations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.