Skip to content

Stdlib: drop phantom array_first_key()/array_last_key() (#22793) - #22830

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-22793-array-first-last-key
Jul 24, 2026
Merged

Stdlib: drop phantom array_first_key()/array_last_key() (#22793)#22830
PurHur merged 1 commit into
masterfrom
agent/stdlib-22793-array-first-last-key

Conversation

@PurHur

@PurHur PurHur commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove invented array_first_key() / array_last_key() — Zend/php-src never ships them (array_key_first / array_key_last since 7.3; PHP 8.5 array_first / array_last are values only).
  • Drop CompilerVersion::supportsPhp83ArrayKeyFunctions(), Module registration, spine requires, and positive compliance/AOT fixtures; keep phantom guards on default + PROFILE=8.4.
  • Restamp gen-0 lowering fingerprint after spine edit (Self-host M5: bootstrap-inventory argv driver size floor — grow beyond 451KB stub #8713).

php-src reference: ext/standard/array.c — no array_first_key / array_last_key.
PHP change: delete ext/standard/array_{first,last}_key.php; unregister in ext/standard/Module.php.

Closes #22793

Test plan

  • VM repro (default / 8.4 / 8.5):
    php bin/vm.php test/repro/issue_22793_array_first_last_key_phantom.php
    PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_22793_array_first_last_key_phantom.php
    PHP_COMPILER_PROFILE=8.5 php bin/vm.php test/repro/issue_22793_array_first_last_key_phantom.php
    
    array_first_key=0, array_last_key=0, array_key_first=1; array_first=1 only on 8.5
  • AOT:
    ./phpc build -o /tmp/afk test/repro/issue_22793_array_first_last_key_phantom.php && /tmp/afk
    PHP_COMPILER_PROFILE=8.4 ./phpc build -o /tmp/afk84 … && PHP_COMPILER_PROFILE=8.4 /tmp/afk84
    
  • vendor/bin/phpunit --filter array_first_last_key → OK (6)
  • vendor/bin/phpunit --filter array_first_last_key test/aot/AotTest.php → OK (2)
  • php script/bootstrap-inventory.php --check → OK 6511/6511
  • make north-star5-verify-fast → OK after fingerprint restamp
  • ./script/check-generated-docs.sh → OK

Pre-work gates: release-readiness --jsonuser_release_ready: yes

Made with Cursor

php-src never ships these (only array_key_first/last; PHP 8.5 array_first/last
are values). Remove registration so all profiles match Zend function_exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f7e0111 into master Jul 24, 2026
1 check failed
@PurHur
PurHur deleted the agent/stdlib-22793-array-first-last-key branch July 24, 2026 08:30
PurHur added a commit that referenced this pull request Jul 24, 2026
…2838)

#22830 wrote lowering_source_fingerprint 73d4dfb3… while live source on the
same tree hashes to 6998141b… (all 6730 fingerprint paths match HEAD), which
redded north-star5-verify-fast step 4f-m and user_release_ready. Restamp only;
honest verified-fresh rebuild remains on #22642/#22717.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Regression: array_first_key()/array_last_key() phantom on PROFILE=8.4 — Zend/php-src never ships them (re-#15539, ext/standard/array.c)

1 participant