Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | ? |
RFC? | no |
Symfony version | 3.3.13 |
PHP Version | 7.1.11 |
When dumping data, the VarCloner incorrectly attempts to clone elements in the data tree in doClone() depending on their type, looping on this switch:
// [...]
switch (true) {
case empty($v):
case true === $v:
case \is_int($v):
case \is_float($v):
continue 2;
// [...]
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.