8000 [VarDumper] Dont use empty(), it chokes on eg GMP objects by nicolas-grekas · Pull Request #25209 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[VarDumper] Dont use empty(), it chokes on eg GMP objects #25209

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
Nov 30, 2017

Conversation

nicolas-grekas
Copy link
Member
Q A
Branch? 3.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #25198
License MIT
Doc PR -

@@ -94,8 +94,11 @@ protected function doClone($var)
// Create $stub when the original value $v can not be used directly
// If $v is a nested structure, put that structure in array $a
switch (true) {
case empty($v):
Copy link
Member

Choose a reason for hiding this comment

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

'0' is also empty according to PHP

Copy link
Member Author

Choose a reason for hiding this comment

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

true, but there is no need to make it a special case: handling it in the "is_string" case is enough IMHO

@nicolas-grekas nicolas-grekas force-pushed the vardump-no-empty branch 3 times, most recently from 13d4d1b to 7937ad0 Compare November 30, 2017 09:09
@nicolas-grekas nicolas-grekas merged commit 1b14173 into symfony:3.3 Nov 30, 2017
nicolas-grekas added a commit that referenced this pull request Nov 30, 2017
…(nicolas-grekas)

This PR was merged into the 3.3 branch.

Discussion
----------

[VarDumper] Dont use empty(), it chokes on eg GMP objects

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25198
| License       | MIT
| Doc PR        | -

Commits
-------

1b14173 [VarDumper] Dont use empty(), it chokes on eg GMP objects
@nicolas-grekas nicolas-grekas deleted the vardump-no-empty branch November 30, 2017 14:51
This was referenced Nov 30, 2017
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.

3 participants
0