Skip to content

Stdlib: similar_text() VM + LLVM JIT/AOT - #2447

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-similar_text
May 26, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/stdlib-similar_text

Conversation

@PurHur

@PurHur PurHur commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds similar_text() using PHP’s Oliver algorithm: VM via VmString, JIT/AOT via phpc_similar_text.c (no internal_* wrappers).
  • VM supports optional &$percent; JIT/AOT expose the two-argument form (use bin/vm.php for by-reference percent).
  • PHPT/PHPUnit coverage: VM compliance, JIT compliance, AOT fixture, unit probe.

Test plan

  • vendor/bin/phpunit test/unit/SimilarTextBuiltinTest.php
  • vendor/bin/phpunit test/compliance/SimilarTextVMTest.php
  • vendor/bin/phpunit test/aot/AotTest.php --filter similar_text
  • vendor/bin/phpunit test/compliance/SimilarTextJITTest.php (LLVM MCJIT; harness JIT suite currently segfaults for all string builtins including levenshtein/metaphone — pre-existing env issue)

Closes #2445

Made with Cursor

Add PHP-compatible similar_text() with VmString for VM, phpc_similar_text.c
for native JIT/AOT, and optional &$percent on VM (two-arg form in JIT/AOT).
Closes #2445.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit a517d77 into master May 26, 2026
@PurHur
PurHur deleted the agent/stdlib-similar_text branch May 26, 2026 12:37
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.

Stdlib: similar_text() VM + LLVM JIT/AOT

1 participant