Skip to content

Regression: extension_loaded('brotli') / brotli_compress() true on 8.2 reference profile (ext/brotli) #17563

Closed

Description

@PurHur

Category

Regression · php-src-strict · extension phantom gate

Problem

Docker Zend 8.2 reference image has no ext-brotli (extension_loaded('brotli') false, brotli_compress() undefined). The VM advertises brotli as loaded and exposes compress/uncompress builtins unconditionally.

Repro Zend 8.2 (2026-07-10) VM 8.2 profile (2026-07-10)
extension_loaded('brotli') false true
function_exists('brotli_compress') false true

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.2
php bin/vm.php test/repro/maintainer_gap_brotli_phantom_extension.php'
# Zend: ok · VM: fail
php bin/vm.php test/repro-maintainer/parity_brotli_missing.php
# Zend: undefined function · VM: compress round-trip

Done when

  • On 8.2 reference profile: extension_loaded('brotli') false and brotli_* not in function_exists() unless explicitly enabled
  • Optional forward profile may expose brotli when PHP_COMPILER_PROFILE=8.4 documents it
  • Compliance guard under test/compliance/cases/stdlib/
  • php-src-strict

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 10, 2026
  2. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    claim: cursor-agent-lane-b — starting this run

  3. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    Merged via #17569

    Fix: BrotliExtensionPolicy + CompilerVersion::supportsBrotli() (bz2 phantom pattern). Reference profile withholds extension_loaded('brotli') and brotli_* from function_exists(); PHP_COMPILER_PROFILE=8.4 restores round-trip when libbrotli FFI is available.

    Verification:
    ```bash
    ./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.2
    php bin/vm.php test/repro/maintainer_gap_brotli_phantom_extension.php'

    ok

    ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter brotli_phantom test/compliance/VMTest.php'

    OK (1 test)

    ./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
    source script/php-env.sh && vendor/bin/phpunit --filter brotli_roundtrip test/compliance/VMTest.php'

    OK (1 test)

    ```

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