Skip to content

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

Closed

Description

@PurHur

Category

stdlib · php-src-strict · refs #1492

Problem

Calling unpack() with named parameters format: and string: must compile and run. Zend succeeds; this compiler rejects at compile time:

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 prints unpack_named_ok=1 on Zend vs compile failure on VM.

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 (php-src-strict)

  • Repro green on php bin/vm.php
  • Named unpack() matches Zend

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

    Regression note: #11577 closed via #11584 (742489e) but repro still compile-fails on master a6ef34a — same root cause class as #11575/#11589 (named args + skipped slots).

  3. PurHur commented on Jun 25, 2026

    @PurHur
    OwnerAuthor

    Duplicate of reopened #11577 — same repro, PR #11584 insufficient.

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