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

141341 Commits

Author SHA1 Message Date
Niels Dossche
4152ca5c8a Fix fuzzer support after CALL VM changes (#18491) 2025-05-04 13:25:42 +02:00
Tim Düsterhus
4e23d3d49f [skip ci] Do not interpret PHP version in bug_report.yml as markdown (#18492) 2025-05-04 13:14:47 +02:00
Niels Dossche
b6667c471c Merge branch 'PHP-8.4'
* PHP-8.4:
  Backport lexbor/lexbor#274
2025-05-04 12:58:07 +02:00
Niels Dossche
42ad1c64bf Backport lexbor/lexbor#274
Co-authored-by: Alex Peattie <alexpeattie@gmail.com>

Closes GH-18490.
2025-05-04 12:57:54 +02:00
David Carlier
c0371d3965 Merge branch 'PHP-8.4' 2025-05-03 19:40:28 +01:00
David Carlier
a7b78a5091 Fix ext/date: date_sunrise() new tests.
close GH-18489
2025-05-03 19:40:16 +01:00
David Carlier
0f6e18df8f Merge branch 'PHP-8.4' 2025-05-03 16:56:55 +01:00
David Carlier
004d7cd290 Merge branch 'PHP-8.3' into PHP-8.4 2025-05-03 16:56:32 +01:00
David Carlier
0227d96f48 Fix GH-18481: date_sunrise check sun rise with offset if is finite/is nan
close GH-18484
2025-05-03 16:56:09 +01:00
David CARLIER
bbac6f5c20 GH-18344 add Locale::addLikelySubtags/Locale::minimizeSubtags support. (#18487)
from a minimized locale, addLikelySubtags augments it with likely
subtags so no changes is the locale is already maximized e.g.
`en_Latn_US`, minimizeSubtags on the other hand does the opposite
operation.
2025-05-03 16:20:18 +01:00
David Carlier
07959fc007 Merge branch 'PHP-8.4' 2025-05-02 21:33:02 +01:00
David Carlier
351face053 Merge branch 'PHP-8.3' into PHP-8.4 2025-05-02 21:32:20 +01:00
David Carlier
24ab0f1ea1 Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value.
Close GH-18460
2025-05-02 21:31:50 +01:00
Niels Dossche
60e9fb5a1b Avoid potential integer overflow (#18485) 2025-05-02 15:50:24 +02:00
Ilija Tovilo
59056937bf Fix use-of-uninitialized-value with exception on deprecated const access
Closes GH-18478
2025-05-02 11:57:16 +02:00
Saki Takamachi
f1d259a07b ext/intl: Fix for the issue where strlen could potentially become negative (#18477) 2025-05-02 15:10:16 +09:00
Jakub Zelenka
dd5733202d Document contributor certification in CONTRIBUTING.md [skip ci] (#18356) 2025-05-01 16:30:48 +01:00
Ilija Tovilo
178fc2db82 [skip ci] Fix var count in opcache test for i386 2025-05-01 12:00:26 +02:00
Niels Dossche
a1e1a7a721 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update NEWS for the intl reference fixes
  Fix reference handling of IntlTimeZone::getCanonicalID/intltz_get_canonical_id
  Fix reference handling of grapheme_extract()
  Fix numfmt_parse_currency() reference handling
2025-05-01 10:42:30 +02:00
Niels Dossche
8d6e377ed8 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Update NEWS for the intl reference fixes
  Fix reference handling of IntlTimeZone::getCanonicalID/intltz_get_canonical_id
  Fix reference handling of grapheme_extract()
  Fix numfmt_parse_currency() reference handling
2025-05-01 10:42:25 +02:00
Niels Dossche
9c555f5a84 Update NEWS for the intl reference fixes 2025-05-01 10:41:57 +02:00
Niels Dossche
a090e59b37 Fix reference handling of IntlTimeZone::getCanonicalID/intltz_get_canonical_id
Closes GH-18469.
2025-05-01 10:41:32 +02:00
Niels Dossche
e3105f5f1e Fix reference handling of grapheme_extract()
Closes GH-18471.
2025-05-01 10:40:17 +02:00
Niels Dossche
e3cac07a9b Fix numfmt_parse_currency() reference handling
Closes GH-18472.
2025-05-01 10:39:53 +02:00
Niels Dossche
b2876117f0 Update return types of transliterator_get_error_code(), transliterator_get_error_message(), TransLiterator::getErrorCode(), and TransLiterator::getErrorMessage() (#18470)
Returning false is impossible.
2025-05-01 10:35:43 +02:00
Ilija Tovilo
156d034d3d Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Remove NEWS entry for reverted fix
2025-04-30 22:38:40 +02:00
Ilija Tovilo
d991215a8e [skip ci] Remove NEWS entry for reverted fix 2025-04-30 22:38:12 +02:00
Ilija Tovilo
182ec003cc Merge branch 'PHP-8.4'
* PHP-8.4:
  Revert "Fix infinite recursion on deprecated attribute evaluation"
2025-04-30 20:54:31 +02:00
Ilija Tovilo
386ab1dad2 Revert "Fix infinite recursion on deprecated attribute evaluation"
This reverts commit 272f7f75e2.

Reverts GH-17712 for the PHP-8.4 branch. This will be reapplied later
with a fix for GH-18463 (GH-18464).
2025-04-30 20:52:56 +02:00
Levi Morrison
6406d5f792 zlib: use zend_string_{extend,truncate} over *_realloc (#18462)
These cases seemed obvious enough to me to confidently change as an
outsider to zlib.
2025-04-30 08:18:04 -06:00
Niels Dossche
39a56a1687 Fix opcode length of ZEND_DECLARE_ATTRIBUTED_CONST in JIT-IR component (#18457)
Introduced in 3f03f7ed.
2025-04-30 08:17:56 +02:00
Saki Takamachi
c5f3281446 ext/bcmath: Improving bcpow() performance (#18099) 2025-04-30 08:05:28 +09:00
David Carlier
26dbcb7640 Merge branch 'PHP-8.4' 2025-04-29 22:48:52 +01:00
David Carlier
e18498ee27 Merge branch 'PHP-8.3' into PHP-8.4 2025-04-29 22:48:43 +01:00
David Carlier
d9d58c9d79 Revert "Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value."
This reverts commit bb431f124c.
2025-04-29 22:48:16 +01:00
David Carlier
bb431f124c Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value. 2025-04-29 22:41:32 +01:00
David Carlier
ad65698a48 ext/curl: CURLOPT_FOLLOWLOCATION option handling.
it had been considered as boolean for years but since 8.13, it can
accept values beyond 1L, respectively CURLFOLLOW_OBEYCODE and
CURLFOLLOW_FIRSTONLY.

close GH-18444
2025-04-29 21:53:38 +01:00
Niels Dossche
82e09db0e9 Use reverse-unwinding goto-style error-handling in grapheme_levenshtein (#18451)
This reduces repetition and makes it harder to accidentally miss
cleaning up something.
2025-04-29 22:48:08 +02:00
Tim Düsterhus
272abc2fb7 Optimize match(true) (#18423)
* Optimizer: Optimize `IS_IDENTICAL` with true/false/null to `TYPE_CHECK`

This optimization is already happening in the compiler for explicit `===`
expressions, but not for `match()`, which also compiles to `IS_IDENTICAL`.

* Optimizer: Optimize `T = BOOL(X) + TYPE_CHECK(T, true)` to just `BOOL`

Resolves php/php-src#18411
2025-04-29 21:39:12 +02:00
DanielEScherzer
3f03f7ed3d [RFC] Add support for attributes on compile-time constants
https://wiki.php.net/rfc/attributes-on-constants
2025-04-29 11:53:09 -07:00
Arnaud Le Blanc
2fea4efa8f Fix merge error (#18453) 2025-04-29 17:06:59 +02:00
Arnaud Le Blanc
0eea5d31e0 run-tests.php: Remove extra env vars in the generated .sh file (#18306) 2025-04-29 10:59:10 +02:00
Arnaud Le Blanc
3737e0aa6f Merge branch 'PHP-8.4'
* PHP-8.4:
  JIT: Check exception on exit
2025-04-29 10:55:38 +02:00
Arnaud Le Blanc
978c01ce15 JIT: Check exception on exit
Add a new exit flag (ZEND_JIT_EXIT_CHECK_EXCEPTION) that enables exception
checking during exit/deoptimization.

We already checked for exceptions during exit/deoptimization, but only when
ZEND_JIT_EXIT_FREE_OP1 or ZEND_JIT_EXIT_FREE_OP2 were set (presumably to
handle exceptions thrown during dtor). The new flag makes it possible to request
it explicitly.

This also fixes two issues in zend_jit_trace_exit():

- By returning 1, we were telling the caller (zend_jit_trace_exit_stub()) to
  execute the original op handler of EG(current_execute_data)->opline, but in
  reality we want to execute EX(opline), which should be EG(exception_op).

- EX(opline) is set to the value of %r15 in zend_jit_trace_exit_stub() before
  calling zend_jit_trace_exit(), but this may be the address of a
  zend_execute_data when the register is being reused to cache EX(call).

Fixes GH-18262
Closes GH-18297
2025-04-29 10:55:31 +02:00
Niels Dossche
f1b73353e4 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18417: Windows SHM reattachment fails when increasing memory_consumption or jit_buffer_size
2025-04-28 19:52:28 +02:00
Niels Dossche
c620fee404 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18417: Windows SHM reattachment fails when increasing memory_consumption or jit_buffer_size
2025-04-28 19:52:22 +02:00
Niels Dossche
7869af6fa8 Fix GH-18417: Windows SHM reattachment fails when increasing memory_consumption or jit_buffer_size
When a first PHP process launches, Opcache creates a shared file mapping
to use as a shm region. The size of this mapping is set by
opcache.memory_consumption.
When a new PHP process launches while the old one is still running,
Opcache tries to reattach to the shm.
When reattaching it tries to map the requested size (i.e. set by
opcache.memory_consumption). However, if the new requested size is
larger than the size used in the original file mapping, then the call
to VirtualProtect() will fail and the new PHP process will fail to
launch.
It's not possible to resize the virtual region on Windows, unless
relying on undocumented APIs like `NtExtendSection` but then we would
sitll need to communicate that to the first process.

This issue is the root cause of Psalm end-to-end tests failing in
GH-18417: Psalm estimates the required memory sizes and relaunches itself
with more memory requested, if its estimate is below the currently allocated
shared memory. This causes a crash on startup and the tests fail.

To solve this, we need to make the mappings unique per requested size.
There are two ideas:
1. Include in zend_system_id. However, this also affects other things
   and may be too overkill.
2. Include it in the filename, this is an easy local change.
   I went with this option.

Closes GH-18443.
2025-04-28 19:51:31 +02:00
Ilija Tovilo
21260754b1 Merge branch 'PHP-8.4'
* PHP-8.4:
  Use --ignore-platform-req=php+ in community build
2025-04-28 17:11:39 +02:00
Ilija Tovilo
8fe5a443e2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Use --ignore-platform-req=php+ in community build
2025-04-28 17:11:30 +02:00
Ilija Tovilo
a16b2c5606 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Use --ignore-platform-req=php+ in community build
2025-04-28 17:11:16 +02:00