php / php/php-src

Check UTF-8 validity for all constant strings on compile time

Offen
#10,853 3 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@iluuu1994 arbeitet bereits daran.

Seit 17.3.2023.

Feature Status: Needs Triage
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

Description

Currently the UTF-8 string validity is checked on demand and cached the string if not interned.

However:

  • when a string is interned, such flag cannot be cached on runtime (at least not due TS)
  • it is not stored back to the source script cache/opcache, ie. the validity is checked on every request at least once
  • when a string is created from unvalidated source before checking, the validation cannot be cached
  • currently only "valid UTF-8" flag is cached , but when a string is "invalid UTF-8", nothing is cached at all

This is a feature request to:
a) check UTF-8 validity on compile time on every const string
b) store a flag if UTF-8 validity was checked or not

Thanks to #10436 the UTF-8 validity check is very fast and the compile time impact should be minimal.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.