Enhanced ArrayHelper::toArray()