[VarDumper] edge case fixes
minor #12047 [VarDumper] edge case fixes (nicolas-grekas)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[VarDumper] edge case fixes

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

Commits
-------

10943d9 [VarDumper] edge case fixes