Skip to content

Bootstrap: php-cfg list-spread overlay missing — Undefined property Assign::$listSpreadRhs warnings (zend_compile.c) #5472

Description

@PurHur

Category

bootstrap | language

Problem

When patches/php-cfg-list-spread.patch (overlay via script/apply-patches.sh) is not applied, every assignment through PHPCfg Op\Expr\Assign emits PHP warnings:

Undefined property: PHPCfg\Op\Expr\Assign::$listSpreadRhs in lib/Compiler.php

List destructuring with spread (#4835, #4889) was implemented assuming the overlay property exists. lib/Compiler.php reads $op->listSpreadRhs at lines ~1238, ~1381, ~4250, ~4254 without guarding property_exists().

Workers see noisy logs on any script; bootstrap/self-host compiles are especially noisy (dozens of warnings per file).

php-src reference

  • php/php-src Zend/zend_compile.c — list destructuring spread lowering
  • Overlay: patches/php-cfg-list-spread.patch (apply_php_cfg_list_spread_overlay() in script/apply-patches.sh)

Repro (verified 2026-06-04)

A — warning count on trivial assign

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
cd /compiler
php bin/vm.php -r "\$a=1;" 2>&1 | grep -c listSpreadRhs || echo 0
'
Patch state grep -c listSpreadRhs on \$a=1;
After ./script/apply-patches.sh 0
Fresh composer install without overlay ≥4 (multiple compile paths)

B — list spread still compiles when patch applied

<?php
[$a, ...$rest] = [1, 2, 3];
var_export([$a, $rest]);

Scope (this repo)

Module Path
Compiler lib/Compiler.php — property_exists($op, 'listSpreadRhs') before all reads
Bootstrap Ensure script/apply-patches.sh runs in Docker CI / composer install post-step (document if missing)
Tests test/unit/ or compliance: compile \$a=1; captures stderr without listSpreadRhs

Do not add C runtime logic; patch overlay or PHP guard only.

Done when

  • Repro A returns 0 warnings with and without vendor patch (guard path)
  • Repro B list-spread still lowers correctly when patch is applied
  • php script/bootstrap-inventory.php --check / self-host compile of lib/Compiler.php no longer spams warnings
  • ./script/ci-fast.sh --filter Compiler or targeted unit green

Verification

./script/apply-patches.sh
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "\$a=1;" 2>&1 | grep listSpreadRhs && exit 1 || exit 0'
make bootstrap-selfhost-link  # no listSpreadRhs noise in log

Related

No activity

Activity on this issue will appear here.

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:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions