1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

72568 Commits

Author SHA1 Message Date
ndossche
c68ede953a Merge branch 'PHP-8.5'
* PHP-8.5:
  bz2: Fix truncation of total output size causing erroneous errors
2026-02-27 23:49:46 +01:00
ndossche
9248a6c70e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  bz2: Fix truncation of total output size causing erroneous errors
2026-02-27 23:47:13 +01:00
Niels Dossche
4ee95fc2f3 bz2: Fix truncation of total output size causing erroneous errors
Also switch to uint64_t as that's used on master and makes the code
simpler to fix.

Closes GH-20807.

Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2026-02-27 23:46:48 +01:00
David Carlier
114c0d6e93 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcre: fix mdata_used race conditions in PCRE functions
2026-02-27 22:18:56 +00:00
David Carlier
7a8a8633ce Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcre: fix mdata_used race conditions in PCRE functions
2026-02-27 22:15:02 +00:00
David Carlier
f8114f554c ext/pcre: fix mdata_used race conditions in PCRE functions
Mirror the mdata_used protection pattern from php_pcre_replace_func_impl
in php_pcre_match_impl, php_pcre_replace_impl, php_pcre_split_impl,
and php_pcre_grep_impl.

close GH-21291
2026-02-27 22:14:41 +00:00
David Carlier
d1ff85f26f Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcre: drop negative-length match tests
2026-02-27 19:18:35 +00:00
David Carlier
27e12b50f4 ext/pcre: drop negative-length match tests
Newer PCRE2 rejects \K in lookarounds at compile time, so the
negative-length match code path can no longer be triggered from
userland PHP. The PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK flag that would
re-enable it is only settable via the C compile context API.
2026-02-27 19:18:25 +00:00
ndossche
4b0a4f47f3 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20906: Assertion failure when messing up output buffers
2026-02-27 18:15:26 +01:00
ndossche
38421684c1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20906: Assertion failure when messing up output buffers
2026-02-27 18:15:20 +01:00
ndossche
1709689256 Fix GH-20906: Assertion failure when messing up output buffers
Closes GH-20908.
2026-02-27 18:14:56 +01:00
Ilija Tovilo
073dcf66bb Merge branch 'PHP-8.5'
* PHP-8.5:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:28 +01:00
Ilija Tovilo
07e29acbd4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:21 +01:00
Ilija Tovilo
6f91209260 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:14 +01:00
Ilija Tovilo
c6ad84fb9e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:04:24 +01:00
Ilija Tovilo
3a57b4ced5 Add RUN_RESOURCE_HEAVY_TESTS env var
Disable resource-heavy tests by default (>1GB of memory usage), unless the
RUN_RESOURCE_HEAVY_TESTS env variable is set.

Fixes GH-20762
Closes GH-20935
2026-02-27 15:00:35 +01:00
Ilija Tovilo
e4f727d61e Implement ReflectionProperty::is{Readable,Writable}()
RFC: https://wiki.php.net/rfc/isreadable-iswriteable

Fixes GH-15309
Fixes GH-16175
Closes GH-16209
2026-02-27 14:26:06 +01:00
Frank Denis
8a907a9bd8 ext/sodium: Add support for libsodium 1.0.21 APIs (#20960)
Add support for new functions present in recent libsodium versions:

- Functions for IP address encryption:
  - sodium_crypto_ipcrypt_*
  - sodium_bin2ip/sodium_ip2bin helpers

- Extendable output functions:
  - SHAKE128/SHAKE256
  - TurboSHAKE128/TurboSHAKE256
2026-02-27 13:11:24 +01:00
Arshid
f46bc8e3a7 ext/mbstring: Replace RETVAL_TRUE/RETVAL_FALSE with RETVAL_BOOL (#21276) 2026-02-27 06:26:11 +09:00
David Carlier
7bc80c0932 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcre: fix new pcre2 test
2026-02-26 19:47:37 +00:00
David Carlier
e64e8b0117 ext/pcre: fix new pcre2 test
close GH-21307
2026-02-26 19:47:19 +00:00
David Carlier
9cc1d323e0 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcre: fix memory leaks on error paths
2026-02-26 18:57:21 +00:00
David Carlier
5406176050 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcre: fix memory leaks on error paths
2026-02-26 18:57:11 +00:00
David Carlier
78702fa470 ext/pcre: fix memory leaks on error paths
Fix pcre2_code leak when pcre2_pattern_info() fails after a successful
pcre2_compile(), and fix match_sets/match_data/marks leak when
offsets[1] < offsets[0] in php_pcre_match_impl().

close GH-21298
2026-02-26 18:56:24 +00:00
David Carlier
9b01f51701 ext/pcntl: Reject negative values in pcntl_alarm()
internal refactorings:

- pcntl_signal_get_handler() max signals handling simplification,
 reusing the num_signals global.
- pcntl_alarm() accepts a zend_long (signed) but passes it to alarm(),
which takes an unsigned int. Negative values silently wrap to large
unsigned values, scheduling an alarm far in the future instead of
raising an error. Also reject large values above unsigned long
max value.

close GH-21282
2026-02-26 18:06:40 +00:00
Louis-Arnaud
5bd1bbdc50 ext/pcre: Fix preg_grep() returning partial array instead of false on error (#21260)
When a PCRE execution error occurs (e.g. malformed UTF-8 with /u
modifier), preg_grep() was returning a partial result array containing
only the entries processed before the error. All other preg_* functions
return false on execution errors.

After the match loop, check PCRE_G(error_code) and if an error
occurred, destroy the partial array and return false instead.

Fixes GH-11936
2026-02-26 16:14:53 +00:00
Dmitry Stogov
031b4c66c4 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR
2026-02-25 17:19:52 +03:00
Dmitry Stogov
908723ad09 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR
2026-02-25 17:19:41 +03:00
Dmitry Stogov
f073425426 Update IR
IR commit: d8fbd3b198007f633a255b855cad036758deefb6

Fixes function JIT failures introduced by e792511179
2026-02-25 17:18:25 +03:00
David Carlier
300892ac81 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcre: preg_match() fix memory leak with invalid regexes.
2026-02-24 22:20:15 +00:00
David Carlier
955f82f417 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcre: preg_match() fix memory leak with invalid regexes.
2026-02-24 22:20:06 +00:00
David Carlier
6c45f7a000 ext/pcre: preg_match() fix memory leak with invalid regexes.
close GH-21290
2026-02-24 22:19:27 +00:00
Ilija Tovilo
4156b52296 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix preloaded constant erroneously propagated to file-cached script
2026-02-24 17:31:08 +01:00
Ilija Tovilo
8206eb1cb4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix preloaded constant erroneously propagated to file-cached script
2026-02-24 17:30:14 +01:00
Ilija Tovilo
ec5a1e001d Fix preloaded constant erroneously propagated to file-cached script
Since GH-15021 preloaded constants are propagated to compiled scripts. This is
problematic for file cache, which assumes all referenced zvals are either
persistently allocated or local to the current script. However, preloaded
constants live in shm as immutable, but not persistent.

To solve this, we'd need to duplicate propagated constants in the optimizer when
file cache is used. This is error prone given it needs to happen in many places.
It's debatable whether constant propagation is even correct in this case, as
running the preloaded script on a restart isn't guaranteed to produce the same
result.

Hence, avoid the issue for now by just not relying on preloaded symbols when
file cache is used.

Fixes GH-21052
Closes GH-21281
2026-02-24 17:28:56 +01:00
Dmitry Stogov
68d96e3855 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR (#21288)
2026-02-24 18:41:57 +03:00
Dmitry Stogov
ff73aecc95 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR (#21288)
2026-02-24 18:41:43 +03:00
Dmitry Stogov
e792511179 Update IR (#21288)
IR commit: ef9341183cdd0489a188a87e74f5b02a359df21b
2026-02-24 18:40:53 +03:00
Ilija Tovilo
db0e365f5a Fix missing reference unwrap for FE_FETCH_R in JIT (GH-21265)
Fixes GH-21264
2026-02-24 02:15:07 +01:00
Ilija Tovilo
3bf7d9a7d6 Merge branch 'PHP-8.5'
* PHP-8.5:
  Tweak stack limit values for gh20840.phpt
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:56 +01:00
Ilija Tovilo
48e318f581 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Tweak stack limit values for gh20840.phpt
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:44 +01:00
Ilija Tovilo
f07809f495 Tweak stack limit values for gh20840.phpt
Graciously tested by Andy Postnikov (andypost).

See GH-21086
Closes GH-21275
2026-02-24 02:11:19 +01:00
Ilija Tovilo
9a6a841d77 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:09 +01:00
Ilija Tovilo
3692a5fa57 Tweak stack limit values for gh20583.phpt
Graciously tested by Andy Postnikov (andypost).

See GH-21086
Closes GH-21274
2026-02-24 02:10:47 +01:00
David Carlier
b81686a108 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
2026-02-23 21:26:18 +00:00
David Carlier
92baeddd42 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
2026-02-23 21:26:06 +00:00
David Carlier
296fad10fb ext/pcntl: fix pcntl_signal_dispatch() stale tail pointer and exception handling.
close GH-21259
2026-02-23 21:24:38 +00:00
David Carlier
d1160660b2 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21262: ldap_modify() too strict controls argument validation.
2026-02-23 20:46:52 +00:00
David Carlier
aa44392dfc Fix GH-21262: ldap_modify() too strict controls argument validation.
make it impossible to unset an attribute.

close GH-21263
2026-02-23 20:46:04 +00:00
Arshid
6b92940363 ext/xls: Replace RETVAL_TRUE/RETVAL_FALSE with RETVAL_BOOL (#21278) 2026-02-23 16:01:51 +01:00