Skip to content

test(aot): add array_shift LLVM compile-and-run PHPT#283

Merged
PurHur merged 1 commit into
masterfrom
feat/aot-array-shift-phpt
May 19, 2026
Merged

test(aot): add array_shift LLVM compile-and-run PHPT#283
PurHur merged 1 commit into
masterfrom
feat/aot-array-shift-phpt

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 19, 2026

Summary

  • Add test/fixtures/aot/cases/array_shift.phpt exercised by AotTest via bin/compile.php (LLVM 9 in php-compiler:22.04-dev).
  • Mark array_shift as AOT PHPT in docs/capabilities.md (already had JIT PHPT).

Test output (Docker, tar pipe — bind-mount empty on harness)

Image: php-compiler:22.04-dev, PHP_COMPILER_LLVM_PATH=/opt/llvm9, script/apply-patches.sh applied.

vendor/bin/phpunit --group llvm test/aot/AotTest.php
OK (40 tests, 44 assertions)   # was 39; +1 array_shift

vendor/bin/phpunit --group llvm test/aot/ExampleWebAotTest.php
OK (2 tests, 16 assertions)

Notes

  • PHPT avoids array_shift($a) === null on an empty array: that path segfaults in the AOT binary today (empty shift without comparing to null is fine). Full JIT compliance case still covers null via VM/JIT.
  • Harness host cannot bind-mount the repo; use script/docker-ci-local.sh (tar fallback) for full ci-local.sh.

Test plan

  • AotTest PHPT fixtures (40/40)
  • ExampleWebAotTest web examples AOT
  • Full script/ci-local.sh in Docker (recommended before merge on hosts with working bind-mount)

Made with Cursor

Cover array_shift() on packed list arrays via bin/compile.php, matching
the existing array_pop AOT fixture pattern. Update capabilities.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit cf29dd2 into master May 19, 2026
1 check failed
@PurHur PurHur deleted the feat/aot-array-shift-phpt branch May 19, 2026 13:26
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.

1 participant