Skip to content

Conversation

@fabpot
Copy link
Contributor

@fabpot fabpot commented Sep 24, 2024

No description provided.

@fabpot fabpot force-pushed the set-node-optimization branch 2 times, most recently from be3a491 to f40624c Compare September 24, 2024 14:42
@fabpot fabpot force-pushed the set-node-optimization branch from f40624c to 9855e35 Compare September 24, 2024 14:47
if ($capture) {
$safe = true;
if ($values instanceof TextNode) {
if (Node::class === get_class($values) && !count($values)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this makes me think we should really investigate having a dedicated node class for representing a statement list in 4.x (as suggested in #4292 (comment)), as we have this special case of Node::class === get_class($values) in more and more places

@fabpot fabpot merged commit efc527e into twigphp:3.x Sep 24, 2024
@fabpot fabpot deleted the set-node-optimization branch September 24, 2024 15:04
fabpot added a commit that referenced this pull request Sep 27, 2024
…ode and Nodes (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Deprecate instantiating Node directly, introduce EmptyNode and Nodes

Based on some comments from `@stof`:

See #4292 (comment)
See #4333 (comment)

First interesting usage here: 65ee72a

Commits
-------

8b27898 Deprecate using Node directly, introduce EmptyNode and Nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants