Skip to content

Commit

Permalink
[tests] run 10592 test for PHP >= 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Feb 4, 2025
1 parent 2a50e0d commit bc28414
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tests/unit/src/unitstd/EReg.unit.hx
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,20 @@ new EReg("^" + EReg.escape("\\ ^ $ * + ? . ( ) | { } [ ]") + "$", "").match("\\
~/(\d+)/g.replace("a1234b12","$$1") == "a$1b$1";

// #10592 - null character
#if (!hl && (!php || php_ver >= 8.2))
#if !hl
#if php
// There is a bug in php < 8.2, see #10592
if (php.Global.version_compare(php.Global.phpversion(), "8.2", ">=")) {
#end
var containingNull = new EReg("abc\x00def", "");
containingNull.match("abc") == false;
containingNull.match("abc\x00def") == true;
containingNull.match("abc\x00fed") == false;
f(containingNull.match("abc"));
t(containingNull.match("abc\x00def"));
f(containingNull.match("abc\x00fed"));
var containingNull = ~/abc\x00def/;
containingNull.match("abc") == false;
containingNull.match("abc\x00def") == true;
containingNull.match("abc\x00fed") == false;
f(containingNull.match("abc"));
t(containingNull.match("abc\x00def"));
f(containingNull.match("abc\x00fed"));
#if php
}
#end
#end

0 comments on commit bc28414

Please sign in to comment.