You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 5.4 branch.
Discussion
----------
[ErrorHandler] Handle PHP 8.3 `highlight_file` function output changes
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | PHP 8.3 Compatibility
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License | MIT
PHP 8.3 changes the output from the `highlight_file` function as described here: https://php.watch/versions/8.3/highlight_file-highlight_string-html-changes
I accidentally ran into this head first when using PHP 8.3.0-RC1 in development with Symfony 6.4-dev when my error had no code rendered
Also affected the `{{ '/path/to/file.html.twig'|file_excerpt(140,5) }}` twig code ` file_except` renderer - easier to replicate with that code just throw it into your twig file with a valid `/path/to/file.html.twig` - before this PR there would be no output, after this PR the file except would be shown.
Same fix applied to both files.

After this fix the code rendered returned.

Commits
-------
809cf74 PHP 8.3 highlight_file function output changes
0 commit comments