Skip to content

Regression: highlight_string/highlight_file/php_strip_whitespace Reflection names drift — Zend named args rejected (ext/standard/basic_functions.stub.php) #23785

Closed

Description

@PurHur

Category

bug · php-src-strict · named arguments / Reflection

Problem

Syntax highlighter / strip-whitespace builtins reject Zend stub named arguments. Probed 2026-07-27 vs host Zend 8.2.32 / php bin/vm.php.

Repro Zend 8.2 VM (2026-07-27)
Reflection highlight_string string,return string,return
highlight_string(string:'<?php', return:true) highlighted HTML Unknown named parameter $string
Reflection highlight_file filename,return file_name,return
Reflection php_strip_whitespace filename file_name
php_strip_whitespace(filename: __FILE__) stripped source Unknown named parameter $filename (via same dispatch path)

highlight_string is the classic Reflection-OK / BuiltinParamNames-missing pattern; the file helpers also need name alignment (filename not file_name).

php-src reference

PHP implementation target

  • lib/BuiltinParamNames.php — highlight_string → ['string','return='], highlight_file → ['filename','return='], php_strip_whitespace → ['filename']
  • Align Reflection names for highlight_file / php_strip_whitespace in ext/standard
  • No new C

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_highlight_strip_reflection_names.php'
<?php
try { echo strlen(highlight_string(string: '<?php', return: true)), "\n"; }
catch (Throwable $e) { echo get_class($e), ': ', $e->getMessage(), "\n"; }
try { echo strlen(php_strip_whitespace(filename: __FILE__)), "\n"; }
catch (Throwable $e) { echo get_class($e), ': ', $e->getMessage(), "\n"; }

Done when

  • All three Reflection tables match Zend
  • Named forms succeed on VM
  • Compliance .phpt guard
  • php-src-strict; no php-compiler-strict shortcut

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 27, 2026
  2. PurHur commented on Jul 30, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (issues #25063, #25097, #23785)

    Hard stdlib cluster: highlight_string/file/show_source Zend HTML wire (#25063), next/prev/current on object HT (#25097), highlight Reflection names (#23785). Shipping sequential PRs; starting with #25063.

  3. PurHur commented on Jul 30, 2026

    @PurHur
    OwnerAuthor

    Batch note: #25063 merged (#25128). #25097 blocked on CFG handoff above — #23785 (highlight Reflection names) stays queued as batch item 3, not started.

  4. PurHur commented on Jul 30, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — continuing batch after #25097 merge; implementing #23785 highlight/file/strip Reflection + named filename.

  5. PurHur commented on Jul 30, 2026

    @PurHur
    OwnerAuthor

    Merged via #25153

    Verification

    • Reflection: highlight_file/show_source → filename, return=false; php_strip_whitespace → filename
    • Named filename: / string: / return: OK; legacy file_name: rejected
    • phpunit --filter highlight_strip_reflection_names OK (VM+JIT)

    Batch (#25063, #25097, #23785) complete.

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 machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions