Problem
Several high-frequency string/array builtins throw at JIT compile time:
ext/standard/implode.php — implode() is not implemented for JIT
ext/standard/explode.php — explode() is not implemented for JIT
ext/standard/str_replace.php — str_replace() is not implemented for JIT
VM mode already runs these (compliance/real tests exist for many stdlib functions). AOT/JIT web apps that build HTML from arrays or split paths cannot compile until these are lowered.
Goal
Implement LLVM lowering (or VM fallback shim) for implode, explode, and str_replace with parity to VM semantics for the common web subset.
Tasks
Acceptance criteria
$parts = ['<li>', 'a', '</li>'];
echo implode('', $parts);
$segments = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
…compiles and runs identically in VM, JIT, and AOT.
Key files
ext/standard/implode.php, explode.php, str_replace.php
lib/JIT/Call/Native.php, lib/JIT/Builtin/
Blocks
Related
Problem
Several high-frequency string/array builtins throw at JIT compile time:
ext/standard/implode.php—implode() is not implemented for JIText/standard/explode.php—explode() is not implemented for JIText/standard/str_replace.php—str_replace() is not implemented for JITVM mode already runs these (compliance/real tests exist for many stdlib functions). AOT/JIT web apps that build HTML from arrays or split paths cannot compile until these are lowered.
Goal
Implement LLVM lowering (or VM fallback shim) for
implode,explode, andstr_replacewith parity to VM semantics for the common web subset.Tasks
ext/standard/for each functionJitImplode,JitExplode,JitStrReplacehelpers mirroring existing patterns (JitStrpos,JitStrPad)explode: limit argument, empty-string edge cases per PHPtest/compliance/cases/stdlib/marked for JITimplodeAcceptance criteria
…compiles and runs identically in VM, JIT, and AOT.
Key files
ext/standard/implode.php,explode.php,str_replace.phplib/JIT/Call/Native.php,lib/JIT/Builtin/Blocks
foreach(often paired withimplodefor list HTML)Related
implodekeys mode later)