1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

144679 Commits

Author SHA1 Message Date
Tim Düsterhus
175b7bca8c Merge branch 'PHP-8.5'
* PHP-8.5:
  zend_language_parser: Backup / restore doc comment when parsing attributes (#20896)
2026-01-13 16:08:15 +01:00
Tim Düsterhus
11ae6ad0be zend_language_parser: Backup / restore doc comment when parsing attributes (#20896)
Attributes may themselves contain elements which can have a doc comment on
their own (namely Closures). A doc comment before the attribute list is
generally understood as belonging to the symbol having the attributes.

Fixes php/php-src#20895.
2026-01-13 16:07:50 +01:00
Ilija Tovilo
bf4f8f5c9c Upgrade to mssql 2025
Closes GH-20924
2026-01-13 15:48:11 +01:00
Tim Düsterhus
51f7c634ac Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Fix typo in NEWS
2026-01-13 15:22:48 +01:00
Tim Düsterhus
b757a5c73b [skip ci] Fix typo in NEWS 2026-01-13 15:22:29 +01:00
Ilija Tovilo
ab1f34b3de Upgrade Circle CI build to Ubuntu 24.04
Closes GH-20923
2026-01-13 14:43:59 +01:00
Ilija Tovilo
1075182118 Fix "fptr may be used uninitialized" warning
Older versions of GCC seem to get confused about the call to
zend_ast_call_get_args(ast), and assume it may mutate ast, even though it is
local.
2026-01-13 13:15:31 +01:00
Ilija Tovilo
dc03108459 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix leaked parent property default value
2026-01-13 13:09:29 +01:00
Ilija Tovilo
c35e391b2d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix leaked parent property default value
2026-01-13 13:09:23 +01:00
Ilija Tovilo
4bfaf549f6 Fix leaked parent property default value
Fixes OSS-Fuzz #474613951
Closes GH-20911
2026-01-13 13:08:39 +01:00
Arnaud Le Blanc
0a90dd6f92 Merge branch 'PHP-8.5'
* PHP-8.5:
  NEWS
  Set default_object_handlers when registering internal enums
2026-01-13 12:36:50 +01:00
Arnaud Le Blanc
cc21f5e095 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  NEWS
  Set default_object_handlers when registering internal enums
2026-01-13 12:36:31 +01:00
Arnaud Le Blanc
b273fc7aca NEWS 2026-01-13 12:34:03 +01:00
Arnaud Le Blanc
075b6b85f6 Set default_object_handlers when registering internal enums
Internal enums can be cloned and compared, unlike user enums, because we didn't set default_object_handlers when registering internal enums.

Fix by setting default_object_handlers when registering internal enums.

Fixes GH-20914
Closes GH-20915
2026-01-13 12:32:52 +01:00
Alex Dowad
c34b84ed81 Remove unused conversion code from mbstring
Over the last few years, I refactored mbstring to perform encoding conversion
a buffer at a time, rather than a single byte at a time. This resulted in a
huge performance increase.

After the refactoring, the old "byte-at-a-time" code was retained for two
reasons:

1) It was used by the mailparse PECL extension.
2) It was used to implement mb_strcut for some text encodings.

However, after reviewing mailparse's use of mbstring, it is clear that
mailparse only relies on mbstring for decoding of QPrint, and possibly
Base64. It does not use the byte-at-a-time conversion code for any
other encoding.

Further, mb_strcut only relies on the byte-at-a-time conversion code
for a limited number of legacy text encodings, such as ISO-2022-JP,
HZ, UTF-7, etc.

Hence, we can remove over 5000 lines of unused code without breaking
anything. This will help to reduce binary size, and make the mbstring
codebase easier to navigate for new contributors.
2026-01-13 11:43:44 +09:00
Alex Dowad
11bec6b92f Remove some now-unused code from mbfl_strcut
The legacy mbfl_strcut function is only used to implement mb_strcut
for legacy text encodings which 1) do not use a fixed number of bytes
per codepoint, 2) do not have an 'mblen_table' which can be used to
quickly determine the codepoint length of a byte sequence, and 3) do
not have a specialized 'mb_cut' function which implements mb_strcut
for that text encoding.

Remove unused code from mbfl_strcut, and leave only what is currently
needed for the implementation of mb_strcut.
2026-01-13 11:43:44 +09:00
Niels Dossche
91f095d2ff Merge branch 'PHP-8.5'
* PHP-8.5:
  Add test for GH-20880 (#20919)
2026-01-12 22:45:50 +01:00
Niels Dossche
c80ac797d4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add test for GH-20880 (#20919)
2026-01-12 22:45:43 +01:00
Niels Dossche
1052270001 Add test for GH-20880 (#20919)
Closes GH-20880.
2026-01-12 22:45:24 +01:00
Dmitry Stogov
9d089a8d30 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR (#20916)
2026-01-12 21:24:04 +03:00
Dmitry Stogov
f7f0d228c2 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR (#20916)
2026-01-12 21:23:52 +03:00
Dmitry Stogov
098b1f89bd Update IR (#20916)
IR commit: 40cd6ad28c376cf006c360f39d8aeff6d6e7bf78
2026-01-12 21:23:38 +03:00
Niels Dossche
4e76b9a145 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix bug52820 test for new libcurl release
2026-01-12 18:48:03 +01:00
Niels Dossche
acad49cace Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix bug52820 test for new libcurl release
2026-01-12 18:47:57 +01:00
Niels Dossche
290ebf13e1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix bug52820 test for new libcurl release
2026-01-12 18:47:51 +01:00
Niels Dossche
39da78f422 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug52820 test for new libcurl release
2026-01-12 18:47:45 +01:00
Niels Dossche
636f84adcf Fix bug52820 test for new libcurl release
Reference: GH-20910.
2026-01-12 18:47:33 +01:00
Jordi Kroon
cdd5aa21d8 Fix dateformat_format_variant3 test and split into different files (#20901) 2026-01-12 05:07:02 +00:00
Niels Dossche
d8d754fc31 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20856: heap-use-after-free in SplDoublyLinkedList iterator when modifying during iteration
2026-01-11 20:43:19 +01:00
Niels Dossche
a82a93d64e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20856: heap-use-after-free in SplDoublyLinkedList iterator when modifying during iteration
2026-01-11 20:43:12 +01:00
Niels Dossche
2a2e0e8128 Fix GH-20856: heap-use-after-free in SplDoublyLinkedList iterator when modifying during iteration
The element may be still in use in other places, so the linking pointers
should be kept consistent. If not consistent, the "move forward" code in
the sample test will read a stale, dangling pointer.

Closes GH-20885.
2026-01-11 20:42:25 +01:00
Niels Dossche
c434e046bc Remove LIBXML_XINCLUDE option from valid list of XMLDocument (#20907)
This option is only valid for pull parsers.
2026-01-11 20:38:03 +01:00
Niels Dossche
9b0643ea36 spl: Remove unused fields from spl dllist (#20886) 2026-01-11 15:08:31 +01:00
Ilija Tovilo
1ee38a3dcb Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix block_pass JMP[N]Z optimization
2026-01-11 14:56:11 +01:00
Ilija Tovilo
918dc2355e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix block_pass JMP[N]Z optimization
2026-01-11 14:56:05 +01:00
Ilija Tovilo
f61b1fc036 Fix block_pass JMP[N]Z optimization
In the following optimization:

JMPZ(X,L1) JMP(L2) L1: -> JMPNZ(X,L2) NOP

L1 must not be followed by another block, so that it may safely be followed by
the block containing the JMPNZ. get_next_block() is used to verify L1 is the
direct follower. This function also skips empty blocks, including live, empty
target blocks, which will then implicitly follow the new follow block. This will
result in L1 being followed by two separate blocks, which is not possible.

Resolve this by get_next_block() stopping at target blocks.

Fixes OSS-Fuzz #472563272
Closes GH-20850
2026-01-11 14:55:23 +01:00
Niels Dossche
9ab800ec9b Mark Phar::buildFromIterator() base directory argument as a path
This is like buildFromDirectory() which does it right.

Closes GH-20892.
2026-01-11 12:27:36 +01:00
Ilija Tovilo
2813f62476 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix infinite loop in GC destructor fiber
2026-01-11 01:21:30 +01:00
Ilija Tovilo
99aec78209 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix infinite loop in GC destructor fiber
2026-01-11 01:21:22 +01:00
Ilija Tovilo
6f6c9e35e8 Fix infinite loop in GC destructor fiber
zend_object_release(&fiber->std) may restart the fiber due to finally. Any
thrown exception must be remembered and unset so that the next fiber may
successfully start.

Fixes OSS-Fuzz #471533782
Closes GH-20884
2026-01-11 01:20:32 +01:00
Niels Dossche
fb27990d3d Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20882: phar buildFromIterator breaks with missing base directory
2026-01-10 15:10:53 +01:00
Niels Dossche
b18b11ee28 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20882: phar buildFromIterator breaks with missing base directory
2026-01-10 15:10:08 +01:00
Niels Dossche
a6e0d8e359 Fix GH-20882: phar buildFromIterator breaks with missing base directory
Broke in f57526a07a because of changing a char*+size_t pair to
zend_string* (which can't handle NULL pointers in its macros).

Closes GH-20888.
2026-01-10 15:09:36 +01:00
Tim Düsterhus
265c0c632b Merge branch 'PHP-8.5'
* PHP-8.5:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:37 +01:00
Tim Düsterhus
1f3390283d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:27 +01:00
Tim Düsterhus
b5d6377ada output: Fail starting to output buffer when the output layer is deactivated (#20846)
Fixes php/php-src#20837.
2026-01-10 14:37:52 +01:00
Niels Dossche
c518a6ba8b Merge branch 'PHP-8.5'
* PHP-8.5:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:57 +01:00
Niels Dossche
750c220550 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:51 +01:00
Niels Dossche
60b1f59081 fastcgi: Fix compile warning wrt safe_read() (#20887)
This shouldn't be const. Fixes the following warning:
```
warning: variable 'hdr' is uninitialized when passed as a const pointer argument here
      [-Wuninitialized-const-pointer]
 1054 |         if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
      |                             ^~~
```
2026-01-10 10:49:37 +01:00
Alex Dowad
79b52042e3 Use fast path in more cases when doing case folding with mb_convert_case
mbstring's Unicode case conversion is table-driven, using Minimal Perfect Hash tables.
However, for small codepoint values, we bypass the hashtable lookup and just use
hard-coded conversion logic (i.e. adding or subtracting 0x20 from the appropriate
ASCII range).

For upcasing and downcasing, we had already optimized the conditional which sends
execution down this fast path, to use the fast path for as many codepoint values
as possible. However, for case folding, this had not been done.

This will give a small performance boost for case-folding Unicode text which
includes non-breaking spaces, symbols like ¥ or ™, or accented Latin
characters (used in many European languages).
2026-01-10 13:10:59 +09:00