Skip to content

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

Closed

Description

@PurHur

Category

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

Problem

After one next($array) on [1,2,3], a second next($array) must return the next element (int 3). When the second call is a nested operand inside string concatenation with var_export(..., true), the VM returns true instead of the element.

Standalone next($array) works; dot-concat form fails. Same failure class as #13811 (prev()).

php-src reference

Repro (verified 2026-06-29)

test/repro/maintainer_gap_next_concat_operand.php

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

Scope (PHP-in-PHP first)

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

Done when (php-src-strict)

  • Repro exits 0 on VM
  • next() returns element or false at end in concat contexts
  • JIT/AOT agree when in scope

Verification

php bin/vm.php test/repro/maintainer_gap_next_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: repro script from issue body is now present under test/repro/ (verified VM fails / Zend passes 2026-06-30).

  3. PurHur commented on Jun 30, 2026

    @PurHur
    OwnerAuthor

    Cleanup note: this ticket is closed; the regression re-open for the same next() concat mis-bind is tracked in #13912 (re-#13830). Implementers should use #13912 / compliance guards — maintainer_gap next_concat_operand repro removed in #13927.

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