Skip to content

Stdlib: array_is_list() missing (ext/standard/array.c parity) #9062

Description

@PurHur

Category

stdlib

Problem

array_is_list() is missing (function not found). php-src provides it to detect list-style arrays (0..n-1 integer keys in insertion order).

Repro

<?php
var_dump(array_is_list([]));
var_dump(array_is_list(["a", "b"]));
var_dump(array_is_list([1 => "x"]));
var_dump(array_is_list([0 => "x", 2 => "y"]));
var_dump(array_is_list(["0" => "x", 1 => "y"]));

Expected (Zend/php-src)

bool(true)
bool(true)
bool(false)
bool(false)
bool(false)

Actual (php-compiler)

  • Fatal error: undefined function array_is_list() (or equivalent missing-builtin failure)

php-src reference

  • ext/standard/array.c (zif_array_is_list)
  • Semantics: list array has consecutive integer keys starting at 0 in iteration/insertion order.

Scope (this repo)

  • ext/standard/ VM builtin surface + any shared array key iteration helpers (VM/JIT/AOT if applicable).

Done when

  • Repro matches Zend output under VM (php-src-strict).
  • Add a small compliance test covering empty, packed, non-zero start, holes, and numeric-string key cases.

Activity

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 machineimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions