Skip to content

Regression: current() string-concat nested operand — returns true not element (ext/standard/array.c) #13828

Closed

Description

@PurHur

Category

stdlib · php-src-strict · regression (nested operand in string concatenation)

Problem

After next($array), current($array) must return the current element value (e.g. int 2). When used as a nested operand inside string concatenation with var_export(..., true), the VM returns true instead of the element.

Standalone current($array) and comma-echo forms work; dot-concat form fails. Same failure class as #13811 (prev()).

php-src reference

Repro (verified 2026-06-29)

test/repro/maintainer_gap_current_concat_operand.php

./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_gap_current_concat_operand.php
Check Zend VM
'current='.var_export(current($a), true) after next($a) current=2 current=true
Direct current($a) 2 2

Scope (PHP-in-PHP first)

Layer Path
VM ext/standard/current.php, ext/standard/VmArrayPointer.php
Compiler nested-call / concat operand lowering if mis-binding return type
JIT ext/standard/JitArrayPointer.php after VM green

Fix likely shared with #13811 — audit key() / next() / end() in the same concat pattern.

Done when (php-src-strict)

  • Repro exits 0 on VM
  • Pointer builtins return correct element types in concat/nested contexts
  • JIT/AOT agree when in scope

Verification

php bin/vm.php test/repro/maintainer_gap_current_concat_operand.php

Links

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

    @PurHur
    OwnerAuthor

    Maintainer re-verify 2026-06-30: added test/repro/maintainer_gap_current_concat_operand.php (referenced in issue body but missing from tree). Both Zend 8.2 and VM pass (ok, exit 0). If this was fixed on master recently, consider closing; otherwise adjust repro to the still-failing call shape.

  3. PurHur commented on Jun 30, 2026

    @PurHur
    OwnerAuthor

    Maintainer: repro script from issue body is now present under test/repro/ (verified VM fails / Zend passes 2026-06-30).

  4. PurHur commented on Jun 30, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — batch (issues #13828–#13831 stat AOT + repro guards)

  5. PurHur commented on Jun 30, 2026

    @PurHur
    OwnerAuthor

    Merged via #13902 — repro + InlineCallArgProducerSlotTest guards green on VM (already fixed by #13829 lowering).

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