use ArrayObject::ensure method.