zephir icon indicating copy to clipboard operation
zephir copied to clipboard

Static variables in local scope

Open valVk opened this issue 9 years ago • 5 comments


class Test
{
    public static function testStaticScope()
    {
        static somevar;

        let somevar = "static var";

        var_dump(somevar);
    }
}

causes Zephir\ParseException: Syntax error in

zephir commit 37630eead506e1113ea8c83dbc733ed4d28c5edd

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/13344430-static-variables-in-local-scope?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github).

valVk avatar May 06 '15 20:05 valVk

Static variables aren't supported by Zephir

phalcon avatar May 06 '15 21:05 phalcon

Will it be supported or I have to find a way out?

valVk avatar May 07 '15 08:05 valVk

@valVk What does it mean static var? Maybe const?

ovr avatar May 07 '15 15:05 ovr

@ovr that's something completely different http://php.net/manual/en/language.variables.scope.php#language.variables.scope.static

steffengy avatar May 07 '15 19:05 steffengy

@steffengy o0, thanks

ovr avatar May 08 '15 04:05 ovr