I know it is possible to declare the type of function parameters, function return, and class attributes. (as demonstrated below)

```php
class HasString {
    private string $value;

    public function getValue() : string
    {
        return $value;
    }

    public function setAttribute(string $arg0)
    {
        $this->value = $arg0;
    }
}

```

However, the following will not work.

```php
// Tested in PHP 7.4.1
string $localVar = "value"; // Parse error: syntax error, unexpected '$localVar' (T_VARIABLE) in php shell code on line 1

```

Does php has a syntax that I can use to explicitly declare the type of a local variable?

This would be useful to catch bugs where a variable receives an unexpected value, and to help the IDE identify the variable type when dealing with mixed or unspecified function returns.