---
title: declare
summary: null
url: https://www.fastly.com/documentation/reference/vcl/statements/declare
---

**Available in:** all subroutines

Declares a local variable.

```vcl
declare local var.expiry_time TIME;
```

User-defined variables must be declared `local`, prefixed with `var.`, and must be declared with a [type](https://www.fastly.com/documentation/reference/vcl/types/). They are scoped to the subroutine, and must be declared before they are first used.

Since variables have subroutine scope, it usually makes sense to define them at the top of a subroutine.
