Skip to content

php-in-php: unpack() — delete phpc_unpack.c (~577 lines), JIT/AOT from ext/standard/unpack.php #5442

Closed

Description

@PurHur

Category

php-in-php · stdlib

Problem

unpack() VM lives in ext/standard/unpack.php, but JIT/AOT still link lib/AOT/runtime/phpc_unpack.c (~577 lines). Delete C after LLVM lowering from PHP (pairs #5231 pack() / phpc_pack.c).

php-src reference

Repro (C still linked)

wc -l lib/AOT/runtime/phpc_unpack.c
grep phpc_unpack lib/AOT/Linker.php
<?php
var_export(unpack('C2', "\x01\x02"));

Scope

File Action
lib/AOT/runtime/phpc_unpack.c Delete
lib/AOT/Linker.php Remove link
ext/standard/unpack.php + lib/JIT/Builtin/ JIT/AOT lowering

Done when

  • phpc_unpack.c removed (~577 lines)
  • JIT/AOT unpack PHPT green
  • PR body cites C lines deleted

Related

Activity

  1. added
    enhancementNew feature or request
    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 Jun 4, 2026
  2. PurHur commented on Jun 4, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — starting this run (unpack: delete phpc_unpack.c, UnpackEngine + JIT lowering)

  3. PurHur commented on Jun 4, 2026

    @PurHur
    OwnerAuthor

    Merged via #5469.

    Runtime shrink: removed lib/AOT/runtime/phpc_unpack.c (~577 lines) from AOT Linker.php.

    PHP path: VM uses ext/standard/UnpackEngine.php via VmPack::unpack().

    JIT/AOT: UnpackJitRuntime links lib/JIT/Builtin/unpack_jit_runtime.c bitcode for __compiler_unpack (follow-up: LLVM lowering from UnpackEngine to delete that C shim).

    Verified: UnpackBuiltinTest::testVmUnpack, testVmUnpackInsufficientData, unpack_jit.phpt green in Docker.

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:compilerCompiler / CFG / JITarea: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