Explorar o código

added an explaining comment

Johannes M. Schmitt %!s(int64=12) %!d(string=hai) anos
pai
achega
888839e029
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Serializer/GenericSerializationVisitor.php

+ 2 - 0
Serializer/GenericSerializationVisitor.php

@@ -84,6 +84,8 @@ abstract class GenericSerializationVisitor extends AbstractVisitor
             $this->root = array();
             $this->root = array();
             $rs = &$this->root;
             $rs = &$this->root;
         } else {
         } else {
+            // ArrayObject is specially treated by the json_encode function and
+            // serialized to { } while a mere array would be serialized to [].
             $rs = isset($type['params'][1]) ? new \ArrayObject() : array();
             $rs = isset($type['params'][1]) ? new \ArrayObject() : array();
         }
         }