Skip to content

Fix php-cfg-new-first-class-callable patch on clean install (#9931) - #9934

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-9931-php-cfg-new-fcc-patch
Jun 19, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-9931-php-cfg-new-fcc-patch

Conversation

@PurHur

@PurHur PurHur commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route php-cfg-new-first-class-callable.patch through an anchor-based overlay in apply-patches.sh so KIND_NEW / new C(...) FCC lowering survives Parser.php drift from prior overlays.
  • Reorder patches: apply php-cfg-anonymous-class.patch before the new-FCC overlay (the overlay expects parseExpr_New with anonymous-class handling).
  • Add patch_already_applied marker for KIND_NEW.

Root cause

On a clean composer install, php-cfg-first-class-callable.patch applied but php-cfg-new-first-class-callable.patch failed at Parser.php:1625 because it assumed anonymous-class + stale line anchors. apply-patches.sh exited 1 and release-readiness.sh died in ci_install_deps.

Verification

# Fresh vendor + patches (host)
rm -rf vendor/ircmaxell/php-cfg && composer install -n --prefer-dist --ignore-platform-reqs --no-scripts
./script/apply-patches.sh
# exit 0 — Applied php-cfg-new-first-class-callable.patch (overlay)

# Docker clean install
./script/docker-exec.sh -- bash -lc 'composer install -n --prefer-dist --ignore-platform-reqs && ./script/apply-patches.sh; echo EXIT:$?'
# EXIT:0

# Issue repro (#9767 guard)
php bin/vm.php test/repro/new_first_class_callable.php
# int(42)

# Release readiness reaches gate JSON (no ci_install_deps patch abort)
./script/docker-exec.sh -- bash -lc './script/release-readiness.sh --json'

Closes #9931

Made with Cursor

).

Route KIND_NEW through an anchor-based overlay and apply anonymous-class
before new FCC so parseExpr_New has the expected shape after prior overlays.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit b81e092 into master Jun 19, 2026
@PurHur
PurHur deleted the agent/issue-9931-php-cfg-new-fcc-patch branch June 19, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release v1.1.0: fix php-cfg-new-first-class-callable.patch blocking release-readiness

1 participant