Skip to content

Provide PHP style output of booleans by specifying option.#913

Open
antoineveldhoven wants to merge 2 commits intotwigjs:masterfrom
antoineveldhoven:php-style-booleans
Open

Provide PHP style output of booleans by specifying option.#913
antoineveldhoven wants to merge 2 commits intotwigjs:masterfrom
antoineveldhoven:php-style-booleans

Conversation

@antoineveldhoven
Copy link
Copy Markdown
Contributor

I'm not sure if this is the way to go, since this is a very old issue.
Please share your thoughts @willrowe && @RobLoach about this fix.

Aiming to fix #88

Since this change breaks every boolean test and / or comparison, I've introduced an option in order to enable PHP style boolean outputs.

@willrowe
Copy link
Copy Markdown
Collaborator

I don't see any issue with this since the option is disabled by default. It gives an upgrade path for the next major version to change the default. May be a good idea to include a deprecation notice when the option is not enabled and a boolean is encountered?

@willrowe
Copy link
Copy Markdown
Collaborator

willrowe commented Feb 3, 2026

@RobLoach if this looks good to you then go ahead and merge.

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.

"Twig supports binary operations (+, -, *, /, ~, %, and, or)" incorrect print of boolean

2 participants