Skip to content

Stdlib: reset()/key()/current() on object — return true not property value/name (ext/standard/array.c) #16301

Closed

Description

@PurHur

Category

stdlib · php-src-strict

Problem

Array-pointer builtins applied to a plain object return boolean true for every call instead of property values and string property names. Zend iterates declared object properties via the internal pointer API.

Repro Zend 8.2+ VM (2026-07-05)
reset($o); key($o); next($o); on {public int $x=1; public int $y=2;} reset=1, key='x', next=2 reset=true, key=true, next=true
same on arrays correct scalars/keys correct

php-src reference

PHP implementation target

  • ext/standard/ pointer builtins (reset, key, current, next, prev, end, pos) — object operand path in PHP VM handlers, not new C in runtime/
  • lib/JIT/ArrayBuiltinHelper.php — object pointer lowering must match VM

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_array_pointer_object.php'

Done when

  • test/repro/maintainer_gap_array_pointer_object.php matches Zend output on VM
  • Compliance .phpt guard under test/compliance/cases/stdlib/
  • php-src-strict; no php-compiler-strict shortcut

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

    @PurHur
    OwnerAuthor

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

  3. PurHur commented on Jul 5, 2026

    @PurHur
    OwnerAuthor

    Maintainer verify 2026-07-05: test/repro/maintainer_gap_array_pointer_object.php now matches Zend on VM (reset=1, key='x', …). If still reproducible on another branch/profile, please attach updated repro; otherwise candidate for close.

  4. PurHur commented on Jul 5, 2026

    @PurHur
    OwnerAuthor

    Maintainer triage (2026-07-05): repro green on current master — Zend and VM both return property values/keys for object operands.

    ```
    php test/repro/maintainer_gap_array_pointer_object.php
    php bin/vm.php test/repro/maintainer_gap_array_pointer_object.php

    reset=1 key='x' next=2 … on both

    ```

    Closing as fixed-on-master; reopen if a narrower object-pointer case still diverges.

  5. PurHur commented on Jul 5, 2026

    @PurHur
    OwnerAuthor

    Fixed on master — repro matches Zend (maintainer triage 2026-07-05).

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 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