Skip to content

Cast printed expressions to string so values that cannot be converted to a string (arrays, non-Stringable objects, ...) report a usable stack trace at the print location#4824

Merged
fabpot merged 2 commits into
twigphp:3.xfrom
fabpot:print-string-cast
Jun 3, 2026

Conversation

@fabpot

@fabpot fabpot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Closes #4765
Closes #4780
Closes #4644

Is it what you had in mind @stof?

@fabpot fabpot force-pushed the print-string-cast branch from 79226a7 to 89f886e Compare June 3, 2026 17:56
@fabpot

fabpot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @stof.

@fabpot fabpot merged commit 1a2f2ea into twigphp:3.x Jun 3, 2026
@fabpot fabpot deleted the print-string-cast branch June 3, 2026 17:56
@stof

stof commented Jun 4, 2026

Copy link
Copy Markdown
Member

@fabpot yes

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.

Stack traces are unusable for array-to-string conversions when using the yield-based system Improve error reporting in template render

2 participants