We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 717ca54 commit 2aec2baCopy full SHA for 2aec2ba
src/Engine/Encoder.php
@@ -73,13 +73,9 @@ private function encodeObject($value): string
73
}
74
75
// all other traversables are dictionaries
76
- if ($value instanceof \Traversable) {
77
- return $this->encodeDictionary($value);
78
- }
79
-
80
// also treat stdClass as a dictionary
81
- if ($value instanceof \stdClass) {
82
- return $this->encodeDictionary((array)$value);
+ if ($value instanceof \Traversable || $value instanceof \stdClass) {
+ return $this->encodeDictionary($value);
83
84
85
// try to convert other objects to string
0 commit comments