You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if $v is a GMP number, this switch throws a recoverable fatal error, because the switch evaluation tries to evaluate empty($v) but empty() does not accept a GMP argument:
// Minimal example in psysh:$g = gmp_init('0');
=> GMP {#217}empty($g);
// PHP Recoverable fatal error: Object of class GMP could not be converted to boolean on line 1
The error needs to be caught to avoid crashing the dumper.
The text was updated successfully, but these errors were encountered:
See #25209
Would you like to contribute a caster for GMP numbers btw?
Displaying just "GMP {#217}" is a bit terse, would be great to display the actual value.
…(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
Uh oh!
There was an error while loading. Please reload this page.
When dumping data, the VarCloner incorrectly attempts to clone elements in the data tree in doClone() depending on their type, looping on this switch:
However, if $v is a GMP number, this switch throws a recoverable fatal error, because the switch evaluation tries to evaluate
empty($v)
butempty()
does not accept a GMP argument:The error needs to be caught to avoid crashing the dumper.
The text was updated successfully, but these errors were encountered: