Skip to content

Stdlib: unpack() named format:/string: — compile error vs Zend array (ext/standard/pack.c) #11577

Closed

Description

@PurHur

Category

stdlib · php-src-strict · refs #1492

Problem

unpack() with named parameters format: and string: must compile and return the unpacked array. Zend: unpack_named_ok=1. VM: compile-time failure:

Cannot use positional argument after named argument

Positional unpack('n', $data) works.

Verified 2026-06-25 — test/repro/maintainer_gap_unpack_named_format_string.php.

php-src reference

Repro

test/repro/maintainer_gap_unpack_named_format_string.php

php test/repro/maintainer_gap_unpack_named_format_string.php
php bin/vm.php test/repro/maintainer_gap_unpack_named_format_string.php

Implementation hints (PHP-in-PHP)

Done when

  • Repro: unpack_named_ok=1 on VM/JIT/AOT
  • Named offset: (when added) follows same binder path

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 25, 2026
  2. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #11578, #11577, #11576)

  3. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    Merged via #11584. VM + AOT repro green: unpack_named_ok=1.

  4. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    Reopening: #11584 merged but maintainer_gap_unpack_named_format_string.php still compile-fails on master (2026-06-25). Track remaining work in #11590.

  5. reopened this on Jun 25, 2026
  6. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    Cleanup bot note: not a duplicate of closed #11590 — this is a regression re-file after #11584 merged (2026-06-25). Keeping test/repro/maintainer_gap_unpack_named_format_string.php until this issue closes. Compliance guard: test/compliance/cases/stdlib/unpack_named_format_string.phpt (verify still green on master before claiming).

  7. PurHur commented on Jul 1, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Runtime → PHP — batch (issues #14545, #11577)

  8. PurHur commented on Jul 1, 2026

    @PurHur
    OwnerAuthor

    Repro green on master (2026-07-01): VM + JIT both print unpack_named_ok=1 for test/repro/maintainer_gap_unpack_named_format_string.php — unclaiming from batch.

  9. PurHur commented on Jul 11, 2026

    @PurHur
    OwnerAuthor

    Verified green on master (2026-07-11, worker lane A). VM repro matches Zend; compliance/tests already present. Closing stale open issue.

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-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions