1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Commit Graph

130456 Commits

Author SHA1 Message Date
Alex Dowad 50f87d36e0 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  Fix GH-9535 (unintended behavior change for mb_strcut in PHP 8.1)
2022-11-13 14:44:04 +02:00
Alex Dowad 79ae3090e0 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Fix GH-9535 (unintended behavior change for mb_strcut in PHP 8.1)
2022-11-13 14:42:57 +02:00
Alex Dowad 1562ba5b71 [ci skip] NEWS 2022-11-13 14:40:45 +02:00
NathanFreeman fa0401b0b5 Fix GH-9535 (unintended behavior change for mb_strcut in PHP 8.1)
The existing implementation of mb_strcut extracts part of a
multi-byte encoded string by pulling out raw bytes and then running
them through a conversion filter to ensure that the output is valid
in the requested encoding.

If the conversion filter emits error markers when doing the final
'flush' operation which ends the conversion of the extracted bytes,
these error markers may (in some cases) be included in the output.
The conversion operation does not respect the value of
mb_substitute_character; rather, it always uses '?' as an error marker.
So this issue manifests itself as unwanted '?' characters being
inserted into the output.

This issue has existed for a long time, but became noticeable in PHP
8.1 because for at least some of the supported text encodings, mbstring
is now more strict about emitting error markers when strings end in an
illegal state.

The simplest fix is to suppress error markers during the final flush
operation.

While working on a fix for this problem, another problem with mb_strcut
was discovered; since it decides when to stop consuming bytes from
the input by looking at the byte length of its OUTPUT, anything which
causes extra bytes to be emitted to the output may cause mb_strcut to
not consume all the bytes in the requested range.

The one case where we DO emit extra output bytes is for encodings
which have a selectable mode, like ISO-2022-JP; if a string in such
an encoding ends in a mode which is not the default, we emit an ending
escape sequence which changes back to the default mode. This is done
so that concatenating strings in such encodings is safe.

However, as mentioned, this can cause the output of mb_strcut to be
shorter than it logically should be. This bug has existed for a long
time, and fixing it now will be a BC break, so we may not fix it right
away.

Therefore, tests for THIS fix which don't pass because of that OTHER
bug have been split out into a separate test file (gh9535b.phpt), and
that file has been marked XFAIL.
2022-11-13 14:37:55 +02:00
Arnaud Le Blanc 9575968acc Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix GH-9298: remove all registered signal handlers in pcntl RSHUTDOWN
2022-11-13 11:10:10 +01:00
Arnaud Le Blanc 9d0f5bc16f [ci skip] NEWS 2022-11-13 11:07:46 +01:00
Arnaud Le Blanc d8fc1af809 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Fix GH-9298: remove all registered signal handlers in pcntl RSHUTDOWN
2022-11-13 11:05:28 +01:00
Arnaud Le Blanc 73583bb8c0 [ci skip] NEWS 2022-11-13 11:05:12 +01:00
Erki Aring 5ecbb1b39d Fix GH-9298: remove all registered signal handlers in pcntl RSHUTDOWN 2022-11-13 10:57:58 +01:00
David Carlier e0e347b4a8 Fix GH-9923: Add the SIGINFO constant in pcntl for system supporting it.
Closes #9938
2022-11-12 19:37:32 +00:00
dwo0 9c6dd46f27 Skip tests if extension or SAPI is not included. (#9939)
* Skip test if SAPI is not enabled.
* Skip test if simplexml extension is disabled.
2022-11-11 21:17:15 -05:00
Ilija Tovilo 6e5b989886 Remove unused PHP 8.1 BC layer in JIT (#9937) 2022-11-11 20:03:53 +01:00
Ilija Tovilo a836baefb0 Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Skip function JIT in nightly for ASAN
2022-11-11 19:58:55 +01:00
Ilija Tovilo ac05c8ffbc Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Skip function JIT in nightly for ASAN
2022-11-11 19:58:34 +01:00
Ilija Tovilo a2dcb0364a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [skip ci] Skip function JIT in nightly for ASAN
2022-11-11 19:57:39 +01:00
Ilija Tovilo da54664186 [skip ci] Skip function JIT in nightly for ASAN
This avoids the 6h timeout.
2022-11-11 19:57:00 +01:00
Ilija Tovilo 894f87d8fd Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Backport XFAIL of failing test
2022-11-11 19:46:34 +01:00
Ilija Tovilo 4f370848c5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Backport XFAIL of failing test
2022-11-11 19:46:27 +01:00
Ilija Tovilo bea2dac23c [skip ci] Backport XFAIL of failing test 2022-11-11 19:46:16 +01:00
Ilija Tovilo bcad968b3b Merge branch 'PHP-8.2'
* PHP-8.2:
  Disable opcache file_cache for observer preloading test
2022-11-11 19:33:52 +01:00
Ilija Tovilo 09f071e63b Disable opcache file_cache for observer preloading test 2022-11-11 19:33:32 +01:00
Christoph M. Becker 5aa13183ae No more need to cater to mime_magic extension
This extension is superseeded by fileinfo as of PHP 5.3.0, but the
latter has no such configuration directive.
2022-11-11 17:29:11 +00:00
Christoph M. Becker f6c9a90e19 [ci skip] Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] Fix GH-9918: License information for xxHash is not included in README.REDIST.BINS file
2022-11-10 12:43:31 +01:00
Christoph M. Becker a9765d146e [ci skip] Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] Fix GH-9918: License information for xxHash is not included in README.REDIST.BINS file
2022-11-10 12:42:19 +01:00
Akama Hitoshi af68beb16a [ci skip] Fix GH-9918: License information for xxHash is not included in README.REDIST.BINS file
Closes GH-9919.
2022-11-10 12:37:08 +01:00
Máté Kocsis 93605f286d Make the usage of the role attribute more clear (#9901)
Currently, the role attribute is mainly used to differentiate OO and procedural "aliases" when they are documented on the same page (e.g. https://www.php.net/manual/en/datetime.diff.php). However, these function-method counterparts are not always aliases in fact according to the stubs (#9491). That's why sometimes the usage of the role attribute is ambiguous, thus syncing the manual with the stubs results in false positive diffs.

This change fixes the problem by a very obtrusive way: by changing the value of all role="oop" attributes to the actual class name, like role="DateTime", and by getting rid of all role="procedural" attributes as they became unnecessary. This way, class synopsis pages can clearly reference methods, and skip functions. Additionally, gen_stub.php will be able to generate the correct methodsynopsis role even though a single page describes multiple methods, like `DateTime/DateTimeImmutable/DateTimeInterface::diff()`.
2022-11-10 08:35:46 +01:00
Ilija Tovilo e45afbf0ca Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Skip preloading test on Windows
2022-11-09 20:22:27 +01:00
Ilija Tovilo 12e2610594 [skip ci] Skip preloading test on Windows 2022-11-09 20:22:10 +01:00
Bob Weinand 81c33eebcb Merge branch 'PHP-8.2' 2022-11-09 17:52:01 +01:00
Bob Weinand 0bfdd5691c Fix crash reading module_entry after DL_UNLOAD() when module already loaded
This occurs when the handle is different from the current handle (e.g. copy of the .so file), hence the existing test did not catch that particular case.
2022-11-09 17:51:45 +01:00
Bob Weinand 2cab4874ad Merge branch 'PHP-8.2' 2022-11-09 16:36:50 +01:00
Bob Weinand 4052bbf0e3 Fix opcache preload with observers enabled
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-11-09 16:36:28 +01:00
Bob Weinand 182314c317 Do not report MINIT stage internal class aliases in extensions
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-11-09 16:36:05 +01:00
Christoph M. Becker 75f372295e Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9905: constant() behaves inconsistent when class is undefined
2022-11-09 15:23:51 +01:00
Christoph M. Becker 4b1feda574 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9905: constant() behaves inconsistent when class is undefined
2022-11-09 15:23:21 +01:00
Christoph M. Becker b2186ca7c4 Fix GH-9905: constant() behaves inconsistent when class is undefined
Directly referring to a constant of an undefined throws an exception;
there is not much point in `constant()` raising a fatal error in this
case.

Closes GH-9907.
2022-11-09 15:21:50 +01:00
Bob Weinand cda97e7a5a Merge branch 'PHP-8.2' 2022-11-09 14:19:54 +01:00
Bob Weinand 6bd8f40291 Move observer_declared_function_notify until after pass_two()
For early observing, there already exists a op_array_ctor hook on zend_extension.
However the goal of the declared_function observer is noting the time when a fully defined function starts existing in the function_tables.
This also prevents the observer being called in case there were compilation errors.

Ultimately, this now gives a consistent behaviour with respect to how it works when opcache is enabled:
- pass_two is done, opcodes and flags are all finalized.
- similarly class_linked notifications also only happen once the class is actually finalized.
- any extension wanting to delay the observer call may add the ZEND_COMPILE_IGNORE_OBSERVER compiler_option, then call it itself.
2022-11-09 13:15:41 +01:00
Pierrick Charron 4c372ec600 [ci skip] Order NEWS sections alphabetically 2022-11-09 00:15:51 -05:00
Sara Golemon 4407f401c6 Merge branch 'PHP-8.2'
* PHP-8.2:
  Bump for 8.0.27
2022-11-08 22:11:59 +00:00
Sara Golemon d3b22722a0 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Bump for 8.0.27
2022-11-08 22:11:53 +00:00
Sara Golemon e1c52d1a7c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Bump for 8.0.27
2022-11-08 22:11:39 +00:00
Sara Golemon ac508301c9 Bump for 8.0.27 2022-11-08 22:10:29 +00:00
Pierrick Charron 34c2a2925a Merge branch 'PHP-8.2'
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.1-dev and prepare NEWS for 8.2.0
2022-11-08 15:50:32 -05:00
Pierrick Charron 44d652c00a PHP-8.2 is now for PHP 8.2.1-dev and prepare NEWS for 8.2.0 2022-11-08 13:26:35 -05:00
Patrick Allaert a4e0ac4c96 Merge branch 'PHP-8.2' 2022-11-08 17:58:22 +01:00
Patrick Allaert 631b04387d Merge branch 'PHP-8.1' into PHP-8.2 2022-11-08 17:57:58 +01:00
Patrick Allaert 540488c74e PHP-8.1 is now for PHP 8.1.14-dev 2022-11-08 17:57:34 +01:00
Sergey Panteleev 4244258a62 [ci skip] Update NEWS for PHP 8.2.0 2022-11-08 09:24:02 +03:00
Bob Weinand b3f3414ce9 Merge branch 'PHP-8.2' 2022-11-07 16:43:24 +01:00