Commit e11ecad1 by Paul Klimov

Object handling at `BaseVarDumper::export()` reworked

parent 3469b471
......@@ -182,17 +182,7 @@ class BaseVarDumper
}
break;
case 'object':
if ($var instanceof Arrayable) {
self::exportInternal($var->toArray(), $level);
} elseif ($var instanceof \IteratorAggregate) {
$varAsArray = [];
foreach ($var as $key => $value) {
$varAsArray[$key] = $value;
}
self::exportInternal($varAsArray, $level);
} else {
self::$_output .= serialize($var);
}
self::$_output .= 'unserialize(' . var_export(serialize($var), true) . ')';
break;
default:
self::$_output .= var_export($var, true);
......
......@@ -88,7 +88,7 @@ RESULT;
$var = new \StdClass();
$var->testField = 'Test Value';
$expectedResult = serialize($var);
$expectedResult = "unserialize('" . serialize($var) . "')";
$data[] = [$var, $expectedResult];
return $data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment