protected function dereferenceArray(array &$arrayData)
    {
        try {
            foreach ($arrayData as $idx => $data) {
                // go deeper if is array
                if (is_array($data)) {
                    $this->dereferenceArray($arrayData[$idx]);

                // dereference if it is a reference #changed
                } elseif (false !== ($ref = $this->isReference($data))) {
                    $arrayData[$idx] = $this->getReferenceValue($ref);
                }
            }
        } catch (\Exception $e) {
            throw new LogicException($e->getMessage(), $e->getCode(), $e);
        }
    }