Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
&& ($all_jobs || !$no_jobs || $test_benchmarking)
// push trigger is restricted to official repository.
&& ($repository === 'php/php-src' || $trigger === 'pull_request')) {
$jobs['BENCHMARKING'] = true;
$jobs['BENCHMARKING']['config']['integrated_opcache'] = version_compare($php_version, '8.5', '>=');
}
if ($all_jobs || $test_community) {
$jobs['COMMUNITY']['matrix'] = version_compare($php_version, '8.4', '>=')
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ jobs:
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
${{ !fromJson(inputs.branch).jobs.BENCHMARKING.config.integrated_opcache && 'echo zend_extension=opcache.so >> /etc/php.d/opcache.ini' || '' }}
echo opcache.enable=1 >> /etc/php.d/opcache.ini
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
- name: Setup
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PHP NEWS
(BogdanUngureanu)
. Fixed bug GH-20426 (Spoofchecker::setRestrictionLevel() error message
suggests missing constants). (DanielEScherzer)
. Added grapheme_strrev (Yuya Hamada)

- JSON:
. Enriched JSON last error / exception message with error location.
Expand Down Expand Up @@ -123,6 +124,8 @@ PHP NEWS
defaulted to 0. (Jorg Sowa)
. Fixed bug GH-21058 (error_log() crashes with message_type 3 and
null destination). (David Carlier)
. Fixed bug GH-13204 (glob() fails if square bracket is in current directory).
(ndossche)

- Streams:
. Added so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt stream
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ PHP 8.6 UPGRADE NOTES
. Added ReflectionProperty::isReadable() and ReflectionProperty::isWritable().
RFC: https://wiki.php.net/rfc/isreadable-iswriteable

- Intl:
. `grapheme_strrev()` returns strrev for grapheme cluster unit.
RFC: https://wiki.php.net/rfc/grapheme_strrev

- Standard:
. `clamp()` returns the given value if in range, else return the nearest
bound.
Expand Down
8 changes: 8 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ PHP 8.6 INTERNALS UPGRADE NOTES
. Symbol HAVE_ST_BLOCKS has been removed from php_config.h (use
HAVE_STRUCT_STAT_ST_BLOCKS).

- Windows build system changes:
. Function SETUP_OPENSSL() doesn't accept 6th argument anymore and doesn't
define the HAVE_OPENSSL_SSL_H preprocessor macro anymore.
. Function SETUP_SQLITE3() doesn't define HAVE_SQLITE3_H and HAVE_SQLITE3EXT_H
preprocessor macros anymore.
. Added a new function CHECK_HEADER() which is intended to be used instead of
the CHECK_HEADER_ADD_INCLUDE().

========================
3. Module changes
========================
Expand Down
2 changes: 1 addition & 1 deletion ext/bz2/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG_WITH("bz2", "BZip2", "no");

if (PHP_BZ2 != "no") {
if (CHECK_LIB("libbz2_a.lib;libbz2.lib", "bz2", PHP_BZ2) &&
CHECK_HEADER_ADD_INCLUDE("bzlib.h", "CFLAGS_BZ2")) {
CHECK_HEADER("bzlib.h", "CFLAGS_BZ2")) {
EXTENSION("bz2", "bz2.c bz2_filter.c");
AC_DEFINE('HAVE_BZ2', 1, "Define to 1 if the PHP extension 'bz2' is available.");
// BZ2 extension does this slightly differently from others
Expand Down
6 changes: 5 additions & 1 deletion ext/com_dotnet/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ if (PHP_COM_DOTNET == "yes") {
com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c",
null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_COM_DOTNET', 1, "Define to 1 if the PHP extension 'com_dotnet' is available.");
CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET');

if (CHECK_HEADER('mscoree.h', 'CFLAGS_COM_DOTNET')) {
AC_DEFINE('HAVE_MSCOREE_H', 1, 'Define to 1 if you have the <mscoree.h> header file.');
}

ADD_MAKEFILE_FRAGMENT();
}
2 changes: 1 addition & 1 deletion ext/curl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG_WITH("curl", "cURL support", "no");
if (PHP_CURL != "no") {
var curl_location;
if ((curl_location = CHECK_LIB("libcurl_a.lib;libcurl.lib", "curl", PHP_CURL)) &&
CHECK_HEADER_ADD_INCLUDE("curl/easy.h", "CFLAGS_CURL") &&
CHECK_HEADER("curl/easy.h", "CFLAGS_CURL") &&
SETUP_OPENSSL("curl", PHP_CURL) >= 2 &&
CHECK_LIB("winmm.lib", "curl", PHP_CURL) &&
CHECK_LIB("wldap32.lib", "curl", PHP_CURL) &&
Expand Down
6 changes: 3 additions & 3 deletions ext/dba/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (PHP_DBA != "no") {

if (PHP_DB != "no") {
if (CHECK_LIB("libdb31s.lib;libdb61.lib", "dba", PHP_DBA) &&
CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) {
CHECK_HEADER("db.h", "CFLAGS_DBA")) {
ADD_FLAG("CFLAGS_DBA", "/D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\"");
} else {
WARNING("dba: db handlers not enabled; libraries and headers not found");
Expand All @@ -24,7 +24,7 @@ if (PHP_DBA != "no") {

if (PHP_QDBM != "no") {
if (CHECK_LIB("qdbm_a.lib;qdbm.lib", "dba", PHP_DBA) &&
CHECK_HEADER_ADD_INCLUDE("depot.h", "CFLAGS_DBA", PHP_DBA + ";" + PHP_PHP_BUILD + "\\include\\qdbm")) {
CHECK_HEADER("depot.h", "CFLAGS_DBA", PHP_DBA + ";" + PHP_PHP_BUILD + "\\include\\qdbm")) {
ADD_SOURCES("ext/dba", "dba_qdbm.c", "dba");
AC_DEFINE("QDBM_INCLUDE_FILE", "<depot.h>", "The QDBM handler header file.", false);
AC_DEFINE("DBA_QDBM", 1, "Define to 1 if the dba extension uses the QDBM handler.");
Expand All @@ -35,7 +35,7 @@ if (PHP_DBA != "no") {

if (PHP_LMDB != "no") {
if (CHECK_LIB("liblmdb_a.lib", "dba", PHP_DBA) &&
CHECK_HEADER_ADD_INCLUDE("lmdb.h", "CFLAGS_DBA") &&
CHECK_HEADER("lmdb.h", "CFLAGS_DBA") &&
CHECK_LIB("ntdll.lib", "dba", PHP_DBA)) {
ADD_SOURCES("ext/dba", "dba_lmdb.c", "dba");
AC_DEFINE("LMDB_INCLUDE_FILE", "<lmdb.h>", "The LMDB handler header file.", false);
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG_WITH("dom", "DOM support", "yes");
if (PHP_DOM == "yes") {
if (PHP_LIBXML == "yes" &&
ADD_EXTENSION_DEP('dom', 'libxml') &&
CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_DOM", PHP_PHP_BUILD + "\\include\\libxml2")
CHECK_HEADER("libxml/parser.h", "CFLAGS_DOM", PHP_PHP_BUILD + "\\include\\libxml2")
) {
EXTENSION("dom", "php_dom.c attr.c document.c infra.c \
xml_document.c html_document.c xml_serializer.c html5_serializer.c html5_parser.c namespace_compat.c private_data.c \
Expand Down
4 changes: 2 additions & 2 deletions ext/enchant/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ARG_WITH("enchant", "Enchant Support", "no");

if (PHP_ENCHANT == "yes") {
if (CHECK_HEADER_ADD_INCLUDE("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\enchant") &&
CHECK_HEADER_ADD_INCLUDE("glib.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\glib-2.0")) {
if (CHECK_HEADER("enchant.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\enchant") &&
CHECK_HEADER("glib.h", "CFLAGS_ENCHANT", PHP_ENCHANT+ ";" + PHP_PHP_BUILD + "\\include\\glib-2.0")) {
if (CHECK_LIB("libenchant2.lib", "enchant", PHP_ENCHANT)) {
have_enchant = true;
} else if (CHECK_LIB("libenchant.lib", "enchant", PHP_ENCHANT)) {
Expand Down
2 changes: 1 addition & 1 deletion ext/ffi/config.w32
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG_WITH('ffi', 'ffi support', 'no');

if (PHP_FFI != 'no') {
if (CHECK_HEADER_ADD_INCLUDE("ffi.h", "CFLAGS_FFI", PHP_FFI+ ";" + PHP_PHP_BUILD + "\\include") &&
if (CHECK_HEADER("ffi.h", "CFLAGS_FFI", PHP_FFI+ ";" + PHP_PHP_BUILD + "\\include") &&
CHECK_LIB("libffi.lib", "ffi", PHP_FFI)) {
AC_DEFINE('HAVE_FFI', 1, "Define to 1 if the PHP extension 'ffi' is available.");

Expand Down
25 changes: 13 additions & 12 deletions ext/gd/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@ if (PHP_GD != "no") {
if (
CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) &&
CHECK_LIB("freetype_a.lib;freetype.lib", "gd", PHP_GD) &&
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype") &&
CHECK_HEADER("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype") &&
CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) &&
CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
(CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16") ||
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng15") ||
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng12")) &&
CHECK_HEADER("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd") &&
(CHECK_HEADER("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16") ||
CHECK_HEADER("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng15") ||
CHECK_HEADER("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng12")) &&
(CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) &&
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD) &&
CHECK_HEADER("iconv.h", "CFLAGS_GD", PHP_GD) &&
SETUP_ZLIB_LIB("gd", PHP_GD) &&
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)
CHECK_HEADER("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)
) {
AC_DEFINE('HAVE_ICONV_H', 1, 'Define to 1 if you have the <iconv.h> header');

if (CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) &&
CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")
CHECK_HEADER("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")
) {
AC_DEFINE('HAVE_XPM', 1, "Define to 1 if you have the xpm library.");
AC_DEFINE('HAVE_GD_XPM', 1, "Define to 1 if gd extension has XPM support.");
}
if (PHP_LIBWEBP != "no") {
if ((CHECK_LIB("libwebp_a.lib", "gd", PHP_GD) || CHECK_LIB("libwebp.lib", "gd", PHP_GD)) &&
CHECK_HEADER_ADD_INCLUDE("decode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp") &&
CHECK_HEADER_ADD_INCLUDE("encode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp")) {
CHECK_HEADER("decode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp") &&
CHECK_HEADER("encode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp")) {
AC_DEFINE("HAVE_LIBWEBP", 1, "Define to 1 if you have the libwebp library.");
AC_DEFINE("HAVE_GD_WEBP", 1, "Define to 1 if gd extension has WebP support.");
} else {
Expand All @@ -39,10 +40,10 @@ if (PHP_GD != "no") {
if (PHP_LIBAVIF != "no") {
if (CHECK_LIB("avif_a.lib", "gd", PHP_GD) &&
CHECK_LIB("aom_a.lib", "gd", PHP_GD) &&
CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) {
CHECK_HEADER("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) {
ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF");
} else if (CHECK_LIB("avif.lib", "gd", PHP_GD) &&
CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) {
CHECK_HEADER("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) {
ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF");
} else {
WARNING("libavif not enabled; libraries and headers not found");
Expand Down
2 changes: 1 addition & 1 deletion ext/gettext/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ARG_WITH("gettext", "gettext support", "no");

if (PHP_GETTEXT != "no") {
if (CHECK_LIB("libintl_a.lib;libintl.lib", "gettext", PHP_GETTEXT) && CHECK_HEADER_ADD_INCLUDE("libintl.h", "CFLAGS_GETTEXT")) {
if (CHECK_LIB("libintl_a.lib;libintl.lib", "gettext", PHP_GETTEXT) && CHECK_HEADER("libintl.h", "CFLAGS_GETTEXT")) {
EXTENSION("gettext", "gettext.c", PHP_GETTEXT_SHARED, "-DHAVE_BIND_TEXTDOMAIN_CODESET=1 -DHAVE_DNGETTEXT=1 -DHAVE_NGETTEXT=1 -DHAVE_LIBINTL=1 -DHAVE_DCNGETTEXT=1");
} else {
WARNING("gettext not enabled; libraries and headers not found");
Expand Down
2 changes: 1 addition & 1 deletion ext/gmp/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG_WITH("gmp", "Include GNU MP support.", "no");

if (PHP_GMP != "no") {
if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) &&
CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) {
CHECK_HEADER("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) {
EXTENSION("gmp", "gmp.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
PHP_INSTALL_HEADERS("ext/gmp", "php_gmp_int.h");
AC_DEFINE('HAVE_GMP', 1, "Define to 1 if the PHP extension 'gmp' is available.");
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(X64) {
ADD_SOURCES(hash_sha3_dir, 'KeccakHash.c KeccakSponge.c KeccakP-1600-inplace32BI.c', 'hash');
}

if (!CHECK_HEADER_ADD_INCLUDE('KeccakHash.h', 'CFLAGS_HASH', hash_sha3_dir)) {
if (!CHECK_HEADER('KeccakHash.h', 'CFLAGS_HASH', hash_sha3_dir)) {
// Should NEVER happen
ERROR('Unable to locate SHA3 headers');
}
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG_WITH("iconv", "iconv support", "yes");
if (PHP_ICONV != "no") {
if ((CHECK_LIB("libiconv_a.lib", "iconv", PHP_ICONV) || CHECK_LIB("libiconv.lib", "iconv", PHP_ICONV) ||
CHECK_LIB("iconv_a.lib", "iconv", PHP_ICONV) || CHECK_LIB("iconv.lib", "iconv", PHP_ICONV)) &&
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_ICONV", PHP_ICONV)) {
CHECK_HEADER("iconv.h", "CFLAGS_ICONV", PHP_ICONV)) {

EXTENSION("iconv", "iconv.c", PHP_ICONV_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");

Expand Down
4 changes: 2 additions & 2 deletions ext/intl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (PHP_INTL != "no") {
CHECK_LIB("icuin.lib", "intl", PHP_INTL) &&
CHECK_LIB("icuio.lib", "intl", PHP_INTL) &&
CHECK_LIB("icuuc.lib", "intl", PHP_INTL) &&
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
CHECK_HEADER("unicode/utf.h", "CFLAGS_INTL")) {
// always build as shared - zend_strtod.c/ICU type conflict
EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,
"/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
Expand Down Expand Up @@ -92,7 +92,7 @@ if (PHP_INTL != "no") {
resourcebundle_iterator.cpp",
"intl");

if (CHECK_HEADER_ADD_INCLUDE("unicode/uspoof.h", "CFLAGS_INTL")) {
if (CHECK_HEADER("unicode/uspoof.h", "CFLAGS_INTL")) {
ADD_SOURCES(configure_module_dirname + "/spoofchecker", "\
spoofchecker_class.cpp \
spoofchecker_create.cpp \
Expand Down
59 changes: 59 additions & 0 deletions ext/intl/grapheme/grapheme_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,4 +1135,63 @@ U_CFUNC PHP_FUNCTION(grapheme_levenshtein)
efree(ustring1);
}

U_CFUNC PHP_FUNCTION(grapheme_strrev)
{
zend_string *string;
UText *ut = nullptr;
UErrorCode ustatus = U_ZERO_ERROR;
UBreakIterator *bi;
char *pstr, *end, *p;
zend_string *ret;
int32_t pos = 0, current = 0, end_len = 0;
unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE];

ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(string)
ZEND_PARSE_PARAMETERS_END();

if (ZSTR_LEN(string) == 0) {
RETURN_EMPTY_STRING();
}

pstr = ZSTR_VAL(string);
ut = utext_openUTF8(ut, pstr, ZSTR_LEN(string), &ustatus);

if (U_FAILURE(ustatus)) {
intl_error_set_code(nullptr, ustatus);
intl_error_set_custom_msg(nullptr, "Error opening UTF-8 text");

RETVAL_FALSE;
goto close;
}

bi = nullptr;
ustatus = U_ZERO_ERROR;

bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &ustatus );
ret = zend_string_alloc(ZSTR_LEN(string), 0);
p = ZSTR_VAL(ret);

ubrk_setUText(bi, ut, &ustatus);
pos = ubrk_last(bi);
if (pos == UBRK_DONE) {
goto ubrk_end;
}

current = ZSTR_LEN(string);
for (end = pstr; pos != UBRK_DONE; ) {
pos = ubrk_previous(bi);
end_len = current - pos;
for (int32_t j = 0; j < end_len; j++) {
*p++ = *(pstr + pos + j);
}
current = pos;
}
ubrk_end:
RETVAL_NEW_STR(ret);
ubrk_close(bi);
close:
utext_close(ut);
}

/* }}} */
2 changes: 2 additions & 0 deletions ext/intl/php_intl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ function grapheme_str_split(string $string, int $length = 1): array|false {}

function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = ""): int|false {}

function grapheme_strrev(string $string): string|false {}

/** @param int $next */
function grapheme_extract(string $haystack, int $size, int $type = GRAPHEME_EXTR_COUNT, int $offset = 0, &$next = null): string|false {}

Expand Down
8 changes: 7 additions & 1 deletion ext/intl/php_intl_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added ext/intl/tests/grapheme_strrev.phpt
Binary file not shown.
4 changes: 2 additions & 2 deletions ext/ldap/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ARG_WITH("ldap", "LDAP support", "no");

if (PHP_LDAP != "no") {

if (CHECK_HEADER_ADD_INCLUDE("ldap.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) &&
CHECK_HEADER_ADD_INCLUDE("lber.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) &&
if (CHECK_HEADER("ldap.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) &&
CHECK_HEADER("lber.h", "CFLAGS_LDAP", PHP_PHP_BUILD + "\\include\\openldap;" + PHP_PHP_BUILD + "\\openldap\\include;" + PHP_LDAP) &&
SETUP_OPENSSL("ldap", PHP_LDAP) >= 2 &&
CHECK_LIB("oldap32_a.lib", "ldap", PHP_LDAP) &&
CHECK_LIB("olber32_a.lib", "ldap", PHP_LDAP)&&
Expand Down
4 changes: 2 additions & 2 deletions ext/libxml/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ARG_WITH("libxml", "LibXML support", "yes");
if (PHP_LIBXML == "yes") {
if (CHECK_LIB("libxml2_a_dll.lib;libxml2_a.lib", "libxml") &&
((PHP_ICONV != "no" && !PHP_ICONV_SHARED) || CHECK_LIB("libiconv_a.lib;iconv_a.lib;libiconv.lib;iconv.lib", "libxml")) &&
CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2") &&
CHECK_HEADER_ADD_INCLUDE("libxml/tree.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2")) {
CHECK_HEADER("libxml/parser.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2") &&
CHECK_HEADER("libxml/tree.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2")) {

if (GREP_HEADER("libxml/xmlversion.h", "#define\\s+LIBXML_VERSION\\s+(\\d+)", PHP_PHP_BUILD + "\\include\\libxml2") &&
+RegExp.$1 >= 20904) {
Expand Down
4 changes: 2 additions & 2 deletions ext/mbstring/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG_ENABLE("mbregex", "multibyte regex support", "no");

if (PHP_MBSTRING != "no") {

if (CHECK_HEADER_ADD_INCLUDE("mbstring.h", "CFLAGS_MBSTRING", PHP_MBSTRING + ";" + PHP_PHP_BUILD + "\\include")) {
if (CHECK_HEADER("mbstring.h", "CFLAGS_MBSTRING", PHP_MBSTRING + ";" + PHP_PHP_BUILD + "\\include")) {
EXTENSION("mbstring", "mbstring.c php_unicode.c mb_gpc.c", PHP_MBSTRING_SHARED);
ADD_EXTENSION_DEP('mbstring', 'pcre');

Expand Down Expand Up @@ -42,7 +42,7 @@ if (PHP_MBSTRING != "no") {
AC_DEFINE('HAVE_MBSTRING', 1, "Define to 1 if the PHP extension 'mbstring' is available.");

if (PHP_MBREGEX != "no") {
if (CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_MBSTRING", PHP_MBREGEX) &&
if (CHECK_HEADER("oniguruma.h", "CFLAGS_MBSTRING", PHP_MBREGEX) &&
CHECK_LIB("onig_a.lib;libonig_a.lib", "mbstring", PHP_MBSTRING)) {
AC_DEFINE('HAVE_MBREGEX', 1, 'Define to 1 if mbstring has multibyte regex support enabled.');

Expand Down
Loading
Loading