We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df0117e commit 246b413Copy full SHA for 246b413
ext/json/json_encoder.c
@@ -678,7 +678,7 @@ zend_result php_json_escape_string(
678
#endif
679
680
us = (unsigned char)s[pos];
681
- if (EXPECTED(result != PHP_JSON_NON_ASCII && !ZEND_BIT_TEST(charmap, us))) {
+ if (result != PHP_JSON_NON_ASCII && EXPECTED(!ZEND_BIT_TEST(charmap, us))) {
682
pos++;
683
len--;
684
} else {
@@ -695,9 +695,9 @@ zend_result php_json_escape_string(
695
if (UNEXPECTED(!us)) {
696
if (pos_old && (options & (PHP_JSON_INVALID_UTF8_IGNORE|PHP_JSON_INVALID_UTF8_SUBSTITUTE))) {
697
php_json_append(buf, s, pos_old);
698
- s += pos;
699
- pos = 0;
700
}
+ s += pos;
+ pos = 0;
701
702
if (options & PHP_JSON_INVALID_UTF8_IGNORE) {
703
/* ignore invalid UTF8 character */
0 commit comments