Skip to content
Open
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
4 changes: 3 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.5.0RC4

- PCRE:
. Upgraded to pcre2lib from 10.46 to 10.47. (nielsdos)

- Reflection:
. Fixed bug GH-20217 (ReflectionClass::isIterable() incorrectly returns true
for classes with property hooks). (alexandre-daubois)
Expand All @@ -14,7 +17,6 @@ PHP NEWS
. Fixed bug GH-19798: XP_SOCKET XP_SSL (Socket stream modules): Incorrect
condition for Win32/Win64. (Jakub Zelenka)


23 Oct 2025, PHP 8.5.0RC3

- Core:
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ PHP 8.5 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/url_parsing_api

- PCRE:
. Upgraded pcre2lib from 10.44 to 10.46.
. Upgraded pcre2lib from 10.44 to 10.47.

- PDO_Sqlite:
. Increased minimum release version support from 3.7.7 to 3.7.17.
Expand Down
2 changes: 1 addition & 1 deletion ext/pcre/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

EXTENSION("pcre", "php_pcre.c", false /* never shared */,
"-Iext/pcre/pcre2lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/pcre/pcre2lib", "pcre2_auto_possess.c pcre2_chartables.c pcre2_compile.c pcre2_compile_class.c pcre2_config.c pcre2_context.c pcre2_chkdint.c pcre2_dfa_match.c pcre2_error.c pcre2_jit_compile.c pcre2_maketables.c pcre2_match.c pcre2_match_data.c pcre2_newline.c pcre2_ord2utf.c pcre2_pattern_info.c pcre2_serialize.c pcre2_string_utils.c pcre2_study.c pcre2_substitute.c pcre2_substring.c pcre2_tables.c pcre2_ucd.c pcre2_valid_utf.c pcre2_xclass.c pcre2_find_bracket.c pcre2_convert.c pcre2_extuni.c pcre2_script_run.c", "pcre");
ADD_SOURCES("ext/pcre/pcre2lib", "pcre2_auto_possess.c pcre2_chartables.c pcre2_compile.c pcre2_compile_cgroup.c pcre2_compile_class.c pcre2_config.c pcre2_context.c pcre2_chkdint.c pcre2_dfa_match.c pcre2_error.c pcre2_jit_compile.c pcre2_maketables.c pcre2_match.c pcre2_match_data.c pcre2_match_next.c pcre2_newline.c pcre2_ord2utf.c pcre2_pattern_info.c pcre2_serialize.c pcre2_string_utils.c pcre2_study.c pcre2_substitute.c pcre2_substring.c pcre2_tables.c pcre2_ucd.c pcre2_valid_utf.c pcre2_xclass.c pcre2_find_bracket.c pcre2_convert.c pcre2_extuni.c pcre2_script_run.c", "pcre");
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");

AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Define to 1 if PHP uses the bundled PCRE library.');
Expand Down
4 changes: 3 additions & 1 deletion ext/pcre/config0.m4
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ else
pcre2lib/pcre2_chartables.c
pcre2lib/pcre2_chkdint.c
pcre2lib/pcre2_compile.c
pcre2lib/pcre2_compile_cgroup.c
pcre2lib/pcre2_compile_class.c
pcre2lib/pcre2_config.c
pcre2lib/pcre2_context.c
Expand All @@ -78,8 +79,9 @@ else
pcre2lib/pcre2_find_bracket.c
pcre2lib/pcre2_jit_compile.c
pcre2lib/pcre2_maketables.c
pcre2lib/pcre2_match_data.c
pcre2lib/pcre2_match.c
pcre2lib/pcre2_match_data.c
pcre2lib/pcre2_match_next.c
pcre2lib/pcre2_newline.c
pcre2lib/pcre2_ord2utf.c
pcre2lib/pcre2_pattern_info.c
Expand Down
54 changes: 32 additions & 22 deletions ext/pcre/pcre2lib/pcre2.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,37 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */

#define PCRE2_MAJOR 10
#define PCRE2_MINOR 46
#define PCRE2_MINOR 47
#define PCRE2_PRERELEASE
#define PCRE2_DATE 2025-08-27
#define PCRE2_DATE 2025-10-21

/* When an application links to a PCRE DLL in Windows, the symbols that are
/* When an application links to a PCRE2 DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE2, the appropriate
export setting is defined in pcre2_internal.h, which includes this file. So we
don't change existing definitions of PCRE2_EXP_DECL. */
export setting is defined in pcre2_internal.h, which includes this file. So, we
don't change existing definitions of PCRE2_EXP_DECL.
#if defined(_WIN32) && !defined(PCRE2_STATIC)
# ifndef PCRE2_EXP_DECL
# define PCRE2_EXP_DECL extern __declspec(dllimport)
# endif
#endif

/* By default, we use the standard "extern" declarations. */
By default, we use the standard "extern" declarations. */

#ifndef PCRE2_EXP_DECL
# ifdef __cplusplus
# if defined(_WIN32) && !defined(PCRE2_STATIC)
# define PCRE2_EXP_DECL extern __declspec(dllimport)
# elif defined __cplusplus
# define PCRE2_EXP_DECL extern "C"
# else
# define PCRE2_EXP_DECL extern
# endif
#endif

/* When compiling with the MSVC compiler, it is sometimes necessary to include
a "calling convention" before exported function names. (This is secondhand
information; I know nothing about MSVC myself). For example, something like
a "calling convention" before exported function names. For example:
void __cdecl function(....)
might be needed. In order so make this easy, all the exported functions have
PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
set, we ensure here that it has no effect. */
might be needed. In order to make this easy, all the exported functions have
PCRE2_CALL_CONVENTION just before their names.
PCRE2 normally uses the platform's standard calling convention, so this should
not be set unless you know you need it. */

#ifndef PCRE2_CALL_CONVENTION
#define PCRE2_CALL_CONVENTION
Expand Down Expand Up @@ -324,7 +321,7 @@ pcre2_pattern_convert(). */
#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN 195
#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE 196
#define PCRE2_ERROR_TOO_MANY_CAPTURES 197
#define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED 198
#define PCRE2_ERROR_MISSING_OCTAL_DIGIT 198
#define PCRE2_ERROR_BACKSLASH_K_IN_LOOKAROUND 199
#define PCRE2_ERROR_MAX_VAR_LOOKBEHIND_EXCEEDED 200
#define PCRE2_ERROR_PATTERN_COMPILED_SIZE_TOO_BIG 201
Expand All @@ -343,6 +340,10 @@ pcre2_pattern_convert(). */
#define PCRE2_ERROR_PERL_ECLASS_EMPTY_EXPR 214
#define PCRE2_ERROR_PERL_ECLASS_MISSING_CLOSE 215
#define PCRE2_ERROR_PERL_ECLASS_UNEXPECTED_CHAR 216
#define PCRE2_ERROR_EXPECTED_CAPTURE_GROUP 217
#define PCRE2_ERROR_MISSING_OPENING_PARENTHESIS 218
#define PCRE2_ERROR_MISSING_NUMBER_TERMINATOR 219
#define PCRE2_ERROR_NULL_ERROROFFSET 220

/* "Expected" matching error codes: no match and partial match. */

Expand Down Expand Up @@ -432,6 +433,11 @@ released, the numbers must not be changed. */
#define PCRE2_ERROR_JIT_UNSUPPORTED (-68)
#define PCRE2_ERROR_REPLACECASE (-69)
#define PCRE2_ERROR_TOOLARGEREPLACE (-70)
#define PCRE2_ERROR_DIFFSUBSPATTERN (-71)
#define PCRE2_ERROR_DIFFSUBSSUBJECT (-72)
#define PCRE2_ERROR_DIFFSUBSOFFSET (-73)
#define PCRE2_ERROR_DIFFSUBSOPTIONS (-74)
#define PCRE2_ERROR_BAD_BACKSLASH_K (-75)


/* Request types for pcre2_pattern_info() */
Expand Down Expand Up @@ -484,6 +490,7 @@ released, the numbers must not be changed. */
#define PCRE2_CONFIG_NEVER_BACKSLASH_C 13
#define PCRE2_CONFIG_COMPILED_WIDTHS 14
#define PCRE2_CONFIG_TABLES_LENGTH 15
#define PCRE2_CONFIG_EFFECTIVE_LINKSIZE 16

/* Optimization directives for pcre2_set_optimize().
For binary compatibility, only add to this list; do not renumber. */
Expand Down Expand Up @@ -743,14 +750,14 @@ PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \
PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \
pcre2_match_data_create_from_pattern(const pcre2_code *, \
pcre2_general_context *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_match_data_free(pcre2_match_data *); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
uint32_t, pcre2_match_data *, pcre2_match_context *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_match_data_free(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
pcre2_get_mark(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
Expand All @@ -762,7 +769,9 @@ PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \
pcre2_get_ovector_pointer(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
pcre2_get_startchar(pcre2_match_data *);
pcre2_get_startchar(pcre2_match_data *); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_next_match(pcre2_match_data *, PCRE2_SIZE *, uint32_t *);


/* Convenience functions for handling matched substrings. */
Expand Down Expand Up @@ -942,6 +951,7 @@ pcre2_compile are called by application code. */
#define pcre2_match_data_create PCRE2_SUFFIX(pcre2_match_data_create_)
#define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_)
#define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_)
#define pcre2_next_match PCRE2_SUFFIX(pcre2_next_match_)
#define pcre2_pattern_convert PCRE2_SUFFIX(pcre2_pattern_convert_)
#define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_)
#define pcre2_serialize_decode PCRE2_SUFFIX(pcre2_serialize_decode_)
Expand Down
20 changes: 12 additions & 8 deletions ext/pcre/pcre2lib/pcre2_auto_possess.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/


/* This module contains functions that scan a compiled pattern and change
repeats into possessive repeats where possible. */


#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "pcre2_internal.h"


#include "pcre2_internal.h"

/* This macro represents the max size of list[] and that is used to keep
track of UCD info in several places, it should be kept on sync with the
Expand Down Expand Up @@ -264,8 +262,10 @@ switch(ptype)
if (c < *p) return !negated;
if (c == *p++) return negated;
}
/* LCOV_EXCL_START */
PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */
break;
/* LCOV_EXCL_STOP */

/* Haven't yet thought these through. */

Expand Down Expand Up @@ -806,21 +806,21 @@ for(;;)

case OP_NOT_DIGIT:
invert_bits = TRUE;
/* Fall through */
PCRE2_FALLTHROUGH /* Fall through */
case OP_DIGIT:
set2 = (const uint8_t *)(cb->cbits + cbit_digit);
break;

case OP_NOT_WHITESPACE:
invert_bits = TRUE;
/* Fall through */
PCRE2_FALLTHROUGH /* Fall through */
case OP_WHITESPACE:
set2 = (const uint8_t *)(cb->cbits + cbit_space);
break;

case OP_NOT_WORDCHAR:
invert_bits = TRUE;
/* Fall through */
PCRE2_FALLTHROUGH /* Fall through */
case OP_WORDCHAR:
set2 = (const uint8_t *)(cb->cbits + cbit_word);
break;
Expand Down Expand Up @@ -1103,7 +1103,7 @@ for(;;)

case OP_NCLASS:
if (chr > 255) return FALSE;
/* Fall through */
PCRE2_FALLTHROUGH /* Fall through */

case OP_CLASS:
if (chr > 255) break;
Expand Down Expand Up @@ -1141,8 +1141,10 @@ for(;;)
if (list[1] == 0) return TRUE;
}

/* LCOV_EXCL_START */
PCRE2_DEBUG_UNREACHABLE(); /* Control should never reach here */
return FALSE; /* Avoid compiler warnings */
/* LCOV_EXCL_STOP */
}


Expand Down Expand Up @@ -1181,11 +1183,13 @@ for (;;)
{
c = *code;

/* LCOV_EXCL_START */
if (c >= OP_TABLE_LENGTH)
{
PCRE2_DEBUG_UNREACHABLE();
return -1; /* Something gone wrong */
}
/* LCOV_EXCL_STOP */

if (c >= OP_STAR && c <= OP_TYPEPOSUPTO)
{
Expand Down
8 changes: 4 additions & 4 deletions ext/pcre/pcre2lib/pcre2_chkdint.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/


/* This file contains functions to implement checked integer operation */

#ifndef PCRE2_PCRE2TEST
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifndef PCRE2_PCRE2TEST
#include "pcre2_internal.h"
#endif



/*************************************************
* Checked Integer Multiplication *
*************************************************/
Expand Down
Loading