Skip to content

Function scoped variables overwriting parent scope in v5.0.0-rc3 #952

@Snor

Description

@Snor

In this example, the $var assignment inside the function persists outside of the function:

{function name=test}
    {$var="b"}
{/function}

{$var="a"}

{test}

{$var}

So Smarty 4 would output "a" as you'd expect, but Smarty v5.0.0-rc3 outputs "b".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions