Skip to content

Symfony serializer Circular __construct #19232

Closed
@electromuis

Description

@electromuis

I had a bug in my code which went as follows:

    public function getAsOptional(){
        return new self([], array_merge($this->optionalFields, $this->requiredFields), $this->flags);
    }

This together with the GetSetMethodNormalizer makes an infinite loop of new Objects. It filled all 8 gigs of ram, php just threw the 60 second timeout.

Would it be an idea to update Symfony\Component\Serializer\Normalizer\AbstractNormalizer->isCircularReference for this case?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions