Skip to content

PHP 8.3 highlight_file/highlight_string output changes #8313

Closed

Description

@PhilETaylor

Feature Request

Provide a migration rector for highlight_file/highlight_string for PHP 8.3 (and for UP_TO_PHP_83 LevelSetList etc)

PHP 8.3 makes several changes to how the highlighter process white-spaces, and now wraps the output with a <pre></pre> HTML tag. Further, it no longer converts new-line characters to HTML
tags, resulting in a multi-line highlighted HTML output.

Full details and diff examples at:
https://php.watch/versions/8.3/highlight_file-highlight_string-html-changes

This has already effected the Symfony project here (as an example, already fixed) symfony/symfony#51586

Activity

  1. PhilETaylor commented on Nov 16, 2023

    @PhilETaylor
    Author

    Ignore me - Im being dumb today haha... The signature of the function is the same, its the output that is different haha

    Im such a dumb idiot since I switched to Tea from Coffee....

  2. github-actions commented on Apr 5, 2026

    @github-actions
    Contributor

    This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.

  3. locked as resolved and limited conversation to collaborators on Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions