Skip to content

[symfony/var-exporter] Warning: Undefined array key 3 at &__get($name) #52826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shakaran opened this issue Nov 30, 2023 · 2 comments
Closed

Comments

@shakaran
Copy link
Contributor

Symfony version(s) affected

7.0.0

Description

Getting a field which is a oneToMany reach this part of code

https://github.com/symfony/var-exporter/blob/7.0/LazyGhostTrait.php#L112

Where is not checked with isset() if the key index exist or not properly, assuming always that it is present.

I am using PHP 8.2

How to reproduce

I have a User class with that OneToMany

#[Ignore]
#[ORM\OneToMany(mappedBy: 'followingUser', targetEntity: Follower::class, fetch: 'EXTRA_LAZY', cascade: ['persist', 'remove'], orphanRemoval: true)]
public null|Collection|array $followings = null;

Possible Solution

Check the index at least with isset()

Additional Context

No response

@stloyd
Copy link
Contributor

stloyd commented Nov 30, 2023

Seems like a duplicate of #52793 potentially covered by #52797

@xabbuh
Copy link
Member

xabbuh commented Nov 30, 2023

closing in favour of #52793

@xabbuh xabbuh closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants