Skip to content

[6.x] Allow PHP Tags in Antlers to Override any Variable#11802

Merged
jasonvarga merged 1 commit into
statamic:masterfrom
JohnathonKoster:adjust-php-node-scope-behavior
May 20, 2025
Merged

[6.x] Allow PHP Tags in Antlers to Override any Variable#11802
jasonvarga merged 1 commit into
statamic:masterfrom
JohnathonKoster:adjust-php-node-scope-behavior

Conversation

@JohnathonKoster

Copy link
Copy Markdown
Contributor

This PR fixes #11222 by allowing developers to override any variable when using the {{? ... ?}} or {{$ $}} PHP tags. With the changes in this PR, the following will now be possible without having to explicitly assign the variable first:

{{?
    // This will now update $theVariableName without an explicit assignment.
    array_unshift($theVariableName, 'The Value');
?}}

{{ theVariableName}} ... {{ /theVariableName }}

While this is technically a bug fix, I am targeting 6.x+ as it is a significant behavior change that could impact existing projects.

@jasonvarga jasonvarga merged commit abcf18f into statamic:master May 20, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants