Skip to content

Bootstrap regression: PHP 8.4 asymmetric visibility parse blocked — php-cfg overlay anchor missing (re-#7468/#7460, Zend/zend_compile.c) #9729

Description

@PurHur

Category

bootstrap | language · php-src-strict · regression

Problem

Closed #7468 / #7460 tracked PHP 8.4 asymmetric visibility (public private(set) string $x), but valid syntax still fails at parse/compile:

Multiple access type modifiers are not allowed

./script/apply-patches.sh cannot apply php-cfg asymmetric visibility overlays — Param.php promotionSetVisibility anchor missing. Until php-cfg exposes combined visibility on promoted/ordinary properties, runtime work from #3165 cannot be verified.

php-src reference

Repro

test/repro/maintainer_asymmetric_visibility_public_private_set.php:

<?php
class C {
    public private(set) int $x = 1;
}
$c = new C();
echo $c->x, "\n";
try {
    $c->x = 2;
} catch (Error $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n";
}
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_asymmetric_visibility_public_private_set.php 2>&1 | head -2
./script/apply-patches.sh 2>&1 | grep -i asymmetric || true'
Engine Parse
Zend PHP 8.4+ parses; external write → Error
VM parseAndCompile failure (same message text, no runtime) ❌

Scope

Layer Path
Patches patches/php-cfg-asymmetric-visibility/ — fix Param.php anchor
Parser lib/Ast/AsymmetricVisibilityRewriter.php — consume php-cfg visibility ops
VM write guards once parse succeeds (#8760, #7070)
Self-host spine must compile promoted asymmetric examples

Done when

  • ./script/apply-patches.sh applies asymmetric overlay without anchor-missing log
  • Repro compiles; $c->x reads 1; external $c->x = 2 throws Error matching Zend
  • Compliance PHPTs under test/compliance/cases/language/*asymmetric* green
  • php script/bootstrap-inventory.php --check still green after patch

Links

#1492 · re-open #7468 / #7460 · runtime pairs #8760

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

    IMPORTANTCritical patharea: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