Skip to content

Bootstrap: highlight_string() / highlight_file() — native tokenizer HTML without host highlight_* (ext/standard/url.c) #4824

Description

@PurHur

Category

bootstrap | stdlib

Problem

highlight_string() and highlight_file() VM implementations delegate to host Zend highlight_string() / highlight_file() via ext/standard/VmHighlight.php. Bootstrap/self-host binaries must not call host PHP builtins for syntax highlighting — same class of gap as #4795 (json), #4790 (hash).

php-src reference

Repro

<?php
echo highlight_string('<?php echo 1;', true);
# Zend reference
php repro_highlight.php | head -3

# Native compiler (must not call \highlight_string)
php bin/vm.php repro_highlight.php
# Today: LogicException VM-only or host delegation when Zend missing

Scope (this repo)

Done when

  • php bin/vm.php repro_highlight.php prints HTML matching Zend structure on a fixed snippet without loading host highlight_*.
  • php script/bootstrap-inventory.php --check no longer flags host delegation for these functions.

Related

Activity

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

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions