feat: add PHP strip_tags for AOT and Magician/eval - #901
Open
nahime0 wants to merge 8 commits into
Open
Conversation
Declare PHP 8.5 strip_tags(string, array|string|null = null) in the shared catalog, wire the AOT home and RuntimeFnId, and port php-src php_strip_tags_ex / php_tag_find for Magician/eval. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Emit __rt_strip_tags for AArch64 and Linux x86_64, lower optional allowed_tags (string, null, array, Mixed), and dispatch StripTags through the typed EIR runtime path. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Cover default stripping, allow-lists, Termwind's plain-text check, case-insensitive and namespaced calls, Magician dispatch, and arity. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
PHP leaves the inner text of disallowed tags, so
strip_tags("<p>A</p><b>B</b>", "<p>") is "<p>A</p>B".
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
nahime0
marked this pull request as ready for review
September 5, 2026 10:39
|
Too many files changed for review (220 files, 100 file limit). Bypass the limit by tagging |
The new contract increments the default-feature catalog, eval-registry, AOT-registry, and interpreter-adapter counts by one. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
standard coverage moves to 365/542 and overall builtin coverage to 516/2030. Co-authored-by: Vincenzo Petrucci <nahime0@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds PHP 8.5
strip_tags(string $string, array|string|null $allowed_tags = null): stringon both AOT and Magician/eval.Termwind's
HtmlRenderer::parseusesstrip_tags($html) === $htmlas its plain-text fast path. This change implements onlystrip_tags(no DOM).Semantics follow php-src
PHP_FUNCTION(strip_tags)+php_strip_tags_ex(..., allow_tag_spaces=0)+php_tag_find:<followed by whitespace stays literal ("1 < 2")"<p><a>") and array form (['p','a']→<p><a>)$allowed_tagstype is a TypeErrorChanges
elephc-builtin-contracteval_builtin!+ PHP state machineRuntimeFnId::StripTags,__rt_strip_tags(aarch64 + x86_64), EIR loweringexamples/string-opsdocs/php/strings.md,docs/php/eval.md,ROADMAP.md, generated builtin pages, registry, anddocs/php/compatibility.mdCI
Head
e8188a836is green: 144 successful, 0 failed. The first run failed on catalog bookkeeping (597/484/584/463asserts and an unregenerateddocs/php/compatibility.md); those are fixed. The earlier macos curl-codegen zlib DNS flake retried clean.