. Fixed bug #77743 (Incorrect pi node insertion for jmpznz with identical
successors). (Nikita)
+- PCRE:
+ . Fixed bug #76127 (preg_split does not raise an error on invalid UTF-8).
+ (Nikita)
+
- Phar:
. Fxied bug #77697 (Crash on Big_Endian platform). (Laruence)
match_data = pcre2_match_data_create_from_pattern(pce->re, gctx);
if (!match_data) {
PCRE_G(error_code) = PHP_PCRE_INTERNAL_ERROR;
- return;
+ zval_ptr_dtor(return_value);
+ RETURN_FALSE;
}
}
pcre2_match_data_free(match_data);
}
+ if (PCRE_G(error_code) != PHP_PCRE_NO_ERROR) {
+ zval_ptr_dtor(return_value);
+ RETURN_FALSE;
+ }
+
last:
start_offset = (last_match - ZSTR_VAL(subject_str)); /* the offset might have been incremented, but without further successful matches */
$regex = '/(?=xyz\K)/';
$subject = "aaaaxyzaaaa";
-$v = preg_split($regex, $subject);
-print_r($v);
+var_dump(preg_split($regex, $subject));
$regex = '/(a(?=xyz\K))/';
$subject = "aaaaxyzaaaa";
var_dump($matches);
--EXPECTF--
-Array
-(
- [0] => aaaaxyzaaaa
-)
+bool(false)
Warning: preg_match(): Get subpatterns list failed in %s on line %d
array(0) {
--- /dev/null
+--TEST--
+Bug #76127: preg_split does not raise an error on invalid UTF-8
+--FILE--
+<?php
+var_dump(preg_split("/a/u", "a\xff"));
+var_dump(preg_last_error() == PREG_BAD_UTF8_ERROR);
+?>
+--EXPECT--
+bool(false)
+bool(true)
Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d
NULL
bool(true)
-array(1) {
- [0]=>
- string(6) "ab2c3u"
-}
+bool(false)
bool(true)