Skip to content

php-in-php: drop always-on LibcExtern strncasecmp (#31682) - #31685

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-strncasecmp-31682
Aug 16, 2026
Merged

php-in-php: drop always-on LibcExtern strncasecmp (#31682)#31685
PurHur merged 1 commit into
masterfrom
agent/runtime-php-strncasecmp-31682

Conversation

@PurHur

@PurHur PurHur commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Drop always-on LibcExtern 'strncasecmp' row after routing the last NestedJIT consumers through __compiler_strncasecmp (StringCaseCompare::ABI_STRNCASECMP).
  • Object_::classIdFromRuntimeName and JitFilter::parseBooleanStringToken already ensured CaseCompare; they now look up the compiler ABI instead of libc.
  • User-script strncasecmp() unchanged (CaseCompareJitHelper / VmString).
  • Sync stale LibcNameCollisionRuntimeShrinkTest strcoll expectation (php-in-php: drop always-on LibcExtern strcoll after StringStrcoll trampoline (#31458 shape) #31498 already dropped the row).

Closes #31682

C / always-on shrink

  • Removed 1 always-on libc decl row from lib/JIT/LibcExtern.php (strncasecmp).
  • lib/AOT/runtime/*.c still empty (no new C).

Test plan

  • ./script/phpunit.sh --filter 'LibcExternDeadDeclsRuntimeShrinkTest|LibcNameCollisionRuntimeShrinkTest|StrcasecmpRuntimeShrinkTest::testObjectTypeRoutesStrncasecmpThroughCaseCompare|StrcasecmpRuntimeShrinkTest::testStrncasecmp'OK (20 tests, 181 assertions)
  • ./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''var_dump(strncasecmp("Ab","ab",1)); var_dump(filter_var("TRUE", FILTER_VALIDATE_BOOLEAN));'\'''int(0) / bool(true)
  • Same under php bin/jit.phpint(0) / bool(true)

php-src reference

  • ext/standard/string.cPHP_FUNCTION(strncasecmp) (semantics stay in PHP)
  • ext/filter/logical_filters.c — boolean token parse (JitFilter mirrors VmFilter)

Made with Cursor

Route Object_ class-id and filter_var boolean token compares through
__compiler_strncasecmp so always-on libc strncasecmp is no longer needed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit bf7c55e into master Aug 16, 2026
1 check failed
@PurHur
PurHur deleted the agent/runtime-php-strncasecmp-31682 branch August 16, 2026 23:56
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.

php-in-php: drop always-on LibcExtern strncasecmp after Object_ Type routes via __compiler_strncasecmp (#31655 shape)

1 participant