Skip to content

Stdlib/JIT: stripos()/strripos() case-insensitive search hits JitStringSearch::find() unimplemented #9045

Description

@PurHur

Category

stdlib · jit · php-src-strict

Problem

The JIT lowering for case-insensitive string search is missing:

ext/standard/JitStringSearch.php throws:

LogicException: JitStringSearch::find() case-insensitive path is not implemented

This likely impacts stripos(), strripos(), stristr() and other builtins that require case-folded search in JIT/AOT mode.

php-src reference

  • ext/standard/string.c — PHP_FUNCTION(stripos), strripos, stristr and helper routines

Repro

<?php
var_dump(stripos('Hello', 'he'));   // 0
var_dump(strripos('aAaA', 'aa'));   // 2
# VM (control): should already work
php bin/vm.php repro.php

# JIT (expected to fail today):
php bin/jit.php repro.php

Expected (Zend)

int(0) then int(2).

Actual (JIT today)

Fatal LogicException from JitStringSearch::find() case-insensitive path.

Scope (this repo)

  • ext/standard/JitStringSearch.php — implement case-insensitive path (ASCII + PHP locale rules as php-src does)
  • lib/JIT/Builtin/ lowering for the affected builtins
  • Tests:
    • test/compliance/cases/stdlib/stripos_case_insensitive.phpt
    • Mark backend expectations (VM + JIT) per capability matrix if needed

Done when

  • php bin/jit.php repro.php matches Zend output for the probes
  • VM and JIT agree for the same inputs in php-src-strict mode
  • Capability matrix reflects support (if it was previously VM-only)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions