Skip to content

Commit 9a878b2

Browse files
Merge pull request #20 from ddietz-xqueue/patch-2
fix: avoid usage of undefined variable
2 parents b90200e + 5ca02e1 commit 9a878b2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/json/JSONSerializer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private static function toArray($object)
3535
$type = gettype($object);
3636

3737
if ($type == 'array') {
38+
$result = array();
39+
3840
foreach ($object as $element) {
3941
// call this method on each object in the array
4042
$result[]= self::toArray($element);

0 commit comments

Comments
 (0)