Skip to content

[VarDumper] Fix generator dump on PHP 8.4 #57191

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

Merged
merged 1 commit into from
May 27, 2024

Conversation

alexandre-daubois
Copy link
Member

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

From PHP 8.4, generators dump contains the generating function: php/php-src#14167.

Also, creating a ReflectionGenerator on a closed generator is now permitted, which explains the update in ReflectionCaster to catch anything that may happen in castReflectionGenerator().

} catch (\Exception $e) {
$a[Caster::PREFIX_VIRTUAL.'closed'] = true;

return $a;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep this line and remove the return statement below entirely instead (IMO makes the diff more understandable)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't sure which solution is the most readable, let's take your suggestion

@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

@nicolas-grekas nicolas-grekas merged commit 3fa0149 into symfony:5.4 May 27, 2024
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants