Skip to content

Commit c8d9d2c

Browse files
committed
Merge branch 'master' into internal_vm_interrupt
2 parents 914c283 + 5211787 commit c8d9d2c

File tree

196 files changed

+2546
-1341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+2546
-1341
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
# the problem area and could aid in deciding whether a pull request is ready
66
# for merging.
77
#
8+
# When changing this file, please make sure to commit the changes to the
9+
# earliest supported PHP branch (PHP-X.Y) and not only to the master branch.
10+
# GitHub reads the CODEOWNERS file from the pull request's targeted branch.
11+
# Commit changes here similar to bug fixes:
12+
# https://github.com/php/php-src/blob/master/CONTRIBUTING.md#pull-requests
13+
#
814
# For more information, see the GitHub CODEOWNERS documentation:
915
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
1016

.github/actions/apt-x64/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ runs:
4444
libxml2-dev \
4545
libxslt1-dev \
4646
libpq-dev \
47-
libreadline-dev \
47+
libedit-dev \
4848
libldap2-dev \
4949
libsodium-dev \
5050
libargon2-0-dev \

.github/actions/configure-x64/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ runs:
4141
--enable-sysvshm \
4242
--enable-shmop \
4343
--enable-pcntl \
44-
--with-readline \
44+
--without-readline --with-libedit \
4545
--enable-mbstring \
4646
--with-curl \
4747
--with-gettext \

NEWS

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? ????, PHP 8.4.0alpha3
3+
?? ??? ????, PHP 8.4.0beta1
4+
5+
- PHPDBG:
6+
. array out of bounds, stack overflow handled for segfault handler on windows.
7+
(David Carlier)
8+
9+
10+
01 Aug 2024, PHP 8.4.0alpha4
11+
12+
- GMP:
13+
. RFC: Change GMP bool cast behavior. (Saki Takamachi)
14+
15+
01 Aug 2024, PHP 8.4.0alpha3
416

517
- Core:
618
. Fix GH-14978 (The xmlreader extension phpize build). (Peter Kokot)
719
. Throw Error exception when encountering recursion during comparison, rather
820
than fatal error. (ilutov)
21+
. Added missing cstddef include for C++ builds. (cmb)
22+
. Fixed bug GH-15108 (Segfault when destroying generator during shutdown).
23+
(Arnaud)
924

1025
- BCMath:
1126
. Adjust bcround()'s $mode parameter to only accept the RoundingMode
@@ -20,13 +35,17 @@ PHP NEWS
2035
. /dev/poll events.mechanism for Solaris/Illumos setting had been retired.
2136
(David Carlier)
2237

38+
- GMP:
39+
. The GMP class is now final and cannot be extended anymore. (Girgias)
40+
2341
- Intl:
2442
. Added SpoofChecker::setAllowedChars to set unicode chars ranges.
2543
(David Carlier)
44+
. Fixed bug GH-15087 (IntlChar::foldCase()'s $option is not optional). (cmb)
2645

2746
- Opcache:
2847
. Fixed bug GH-13775 (Memory leak possibly related to opcache SHM placement).
29-
(Arnaud)
48+
(Arnaud, nielsdos)
3049

3150
- OpenSSL:
3251
. Bumped minimum required OpenSSL version to 1.1.0. (cmb)
@@ -41,13 +60,27 @@ PHP NEWS
4160
. pg_convert/pg_insert/pg_update/pg_delete ; regexes are now cached.
4261
(David Carlier)
4362

63+
- Random:
64+
. Fixed bug GH-15094 (php_random_default_engine() is not C++ conforming).
65+
(cmb)
66+
67+
- Readline:
68+
. Fixed readline_info, rl_line_buffer_length/rl_len globals on update.
69+
(David Carlier)
70+
4471
- Standard:
4572
. Fix references in request_parse_body() options array. (nielsdos)
4673
. Add RoundingMode enum. (timwolla, saki)
4774

4875
- Tidy:
4976
. Failures in the constructor now throw exceptions rather than emitting
5077
warnings and having a broken object. (nielsdos)
78+
. Add tidyNode::getNextSibling() and tidyNode::getPreviousSibling().
79+
(nielsdos)
80+
81+
- XMLReader:
82+
. Fixed bug GH-15123 (var_dump doesn't actually work on XMLReader).
83+
(nielsdos)
5184

5285
- XSL:
5386
. Fix trampoline leak in xpath callables. (nielsdos)

UPGRADING

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ PHP 8.4 UPGRADE NOTES
4848
object. This is no longer possible, and cloning a DOMXPath object now throws
4949
an error.
5050

51+
- GMP:
52+
. The GMP class is now final and cannot be extended anymore.
53+
RFC: https://wiki.php.net/rfc/gmp-final
54+
. Casting a GMP object to bool changed so that 0 becomes false and everything else
55+
becomes true.
56+
RFC: https://wiki.php.net/rfc/fix_up_bcmath_number_class
57+
5158
- Intl:
5259
. resourcebundle_get(), ResourceBundle::get(), and accessing offsets on a
5360
ResourceBundle object now throw:
@@ -576,8 +583,9 @@ PHP 8.4 UPGRADE NOTES
576583
decimal number and round it to 0.29. However, "pre-rounding" incorrectly rounds
577584
certain numbers, so this fix removes "pre-rounding" and changes the way numbers
578585
are compared, so that the values are correctly rounded as decimal numbers.
579-
. The maximum precision that can be handled by round() has been extended by
580-
one digit.
586+
. The maximum precision that can be handled by round() has been extended by one
587+
digit. For example, `round(4503599627370495.5)` returned in `4503599627370495.5`,
588+
but now returns `4503599627370496`.
581589
. The default value of the 'cost' option for PASSWORD_BCRYPT for password_hash()
582590
has been increased from '10' to '12'.
583591

@@ -667,6 +675,9 @@ PHP 8.4 UPGRADE NOTES
667675
array_any().
668676
RFC: https://wiki.php.net/rfc/array_find
669677

678+
- Tidy:
679+
. Added tidyNode::getNextSibling() and tidyNode::getPreviousSibling().
680+
670681
- XMLReader:
671682
. Added XMLReader::fromStream(), XMLReader::fromUri(), XMLReader::fromString().
672683
RFC: https://wiki.php.net/rfc/xmlreader_writer_streams

UPGRADING.INTERNALS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ PHP 8.4 INTERNALS UPGRADE NOTES
171171
- M4 macro PHP_SETUP_OPENSSL doesn't accept the 3rd argument anymore.
172172
- M4 macro PHP_EVAL_LIBLINE got a new 3rd argument to override the ext_shared
173173
checks.
174+
- M4 macro PHP_SETUP_LIBXML doesn't define the redundant HAVE_LIBXML symbol
175+
anymore.
176+
- M4 macro PHP_SETUP_ICONV doesn't define the HAVE_ICONV symbol anymore.
174177
- TSRM/tsrm.m4 file and its TSRM_CHECK_PTHREADS M4 macro have been removed.
175178
- Added pkg-config support to find libpq for the pdo_pgsql and pgsql
176179
extensions. The libpq paths can be customized with the PGSQL_CFLAGS and

Zend/Optimizer/zend_inference.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4998,8 +4998,6 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
49984998

49994999
switch (opline->opcode) {
50005000
case ZEND_NOP:
5001-
case ZEND_IS_IDENTICAL:
5002-
case ZEND_IS_NOT_IDENTICAL:
50035001
case ZEND_QM_ASSIGN:
50045002
case ZEND_JMP:
50055003
case ZEND_CHECK_VAR:
@@ -5021,10 +5019,14 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
50215019
case ZEND_FUNC_NUM_ARGS:
50225020
case ZEND_FUNC_GET_ARGS:
50235021
case ZEND_COPY_TMP:
5024-
case ZEND_CASE_STRICT:
50255022
case ZEND_JMP_NULL:
50265023
case ZEND_JMP_FRAMELESS:
50275024
return 0;
5025+
case ZEND_IS_IDENTICAL:
5026+
case ZEND_IS_NOT_IDENTICAL:
5027+
case ZEND_CASE_STRICT:
5028+
/* Array to array comparison may lead to recursion. */
5029+
return (t1 & t2) & MAY_BE_ARRAY_OF_ARRAY;
50285030
case ZEND_SEND_VAR:
50295031
case ZEND_SEND_VAL:
50305032
case ZEND_SEND_REF:

Zend/tests/gh15108-001.phpt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--TEST--
2+
GH-15108 001: Segfault with delegated generator in suspended fiber
3+
--FILE--
4+
<?php
5+
6+
class It implements \IteratorAggregate
7+
{
8+
public function getIterator(): \Generator
9+
{
10+
yield 'foo';
11+
Fiber::suspend();
12+
var_dump("not executed");
13+
}
14+
}
15+
16+
function f() {
17+
yield from new It();
18+
}
19+
20+
$iterable = f();
21+
22+
$fiber = new Fiber(function () use ($iterable) {
23+
var_dump($iterable->current());
24+
$iterable->next();
25+
var_dump("not executed");
26+
});
27+
28+
$ref = $fiber;
29+
30+
$fiber->start();
31+
32+
?>
33+
==DONE==
34+
--EXPECT--
35+
string(3) "foo"
36+
==DONE==

Zend/tests/gh15108-002.phpt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--TEST--
2+
GH-15108 002: Segfault with delegated generator in suspended fiber
3+
--FILE--
4+
<?php
5+
6+
class It implements \IteratorAggregate
7+
{
8+
public function getIterator(): \Generator
9+
{
10+
yield 'foo';
11+
Fiber::suspend();
12+
var_dump("not executed");
13+
}
14+
}
15+
16+
function g() {
17+
yield from new It();
18+
}
19+
20+
function f() {
21+
yield from g();
22+
}
23+
24+
$iterable = f();
25+
26+
$fiber = new Fiber(function () use ($iterable) {
27+
var_dump($iterable->current());
28+
$iterable->next();
29+
var_dump("not executed");
30+
});
31+
32+
$ref = $fiber;
33+
34+
$fiber->start();
35+
36+
?>
37+
==DONE==
38+
--EXPECT--
39+
string(3) "foo"
40+
==DONE==

Zend/tests/gh15108-003.phpt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--TEST--
2+
GH-15108 003: Segfault with delegated generator in suspended fiber
3+
--FILE--
4+
<?php
5+
6+
class It implements \IteratorAggregate
7+
{
8+
public function getIterator(): \Generator
9+
{
10+
yield 'foo';
11+
Fiber::suspend();
12+
var_dump("not executed");
13+
}
14+
}
15+
16+
function f($gen) {
17+
yield from $gen;
18+
}
19+
20+
$a = new It();
21+
$b = f($a);
22+
$c = f($a);
23+
24+
$fiber = new Fiber(function () use ($a, $b, $c) {
25+
var_dump($b->current());
26+
$b->next();
27+
var_dump("not executed");
28+
});
29+
30+
$ref = $fiber;
31+
32+
$fiber->start();
33+
34+
?>
35+
==DONE==
36+
--EXPECT--
37+
string(3) "foo"
38+
==DONE==

Zend/tests/gh15108-004.phpt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
--TEST--
2+
GH-15108 004: Segfault with delegated generator in suspended fiber
3+
--FILE--
4+
<?php
5+
6+
function gen1() {
7+
yield 'foo';
8+
Fiber::suspend();
9+
var_dump("not executed");
10+
};
11+
12+
function gen2($gen) {
13+
yield from $gen;
14+
var_dump("not executed");
15+
}
16+
17+
$a = gen1();
18+
/* Both $b and $c have a root marked with IN_FIBER, but only $b is actually
19+
* running in a fiber (at shutdown) */
20+
$b = gen2($a);
21+
$c = gen2($a);
22+
23+
$fiber = new Fiber(function () use ($a, $b, $c) {
24+
var_dump($b->current());
25+
var_dump($c->current());
26+
$b->next();
27+
var_dump("not executed");
28+
});
29+
30+
$ref = $fiber;
31+
32+
$fiber->start();
33+
34+
?>
35+
==DONE==
36+
--EXPECT--
37+
string(3) "foo"
38+
string(3) "foo"
39+
==DONE==

Zend/tests/gh15108-005.phpt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
--TEST--
2+
GH-15108 005: Segfault with delegated generator in suspended fiber
3+
--FILE--
4+
<?php
5+
6+
class It implements \IteratorAggregate
7+
{
8+
public function getIterator(): \Generator
9+
{
10+
yield 'foo';
11+
Fiber::suspend();
12+
var_dump("not executed");
13+
}
14+
}
15+
16+
function f() {
17+
yield from new It();
18+
}
19+
20+
function g() {
21+
yield from f();
22+
}
23+
24+
function h() {
25+
/* g() is an intermediate node and will not be marked with IN_FIBER */
26+
yield from g();
27+
}
28+
29+
$iterable = h();
30+
var_dump($iterable->current());
31+
32+
$fiber = new Fiber(function () use ($iterable) {
33+
$iterable->next();
34+
var_dump("not executed");
35+
});
36+
37+
$ref = $fiber;
38+
39+
$fiber->start();
40+
41+
?>
42+
==DONE==
43+
--EXPECT--
44+
string(3) "foo"
45+
==DONE==

0 commit comments

Comments
 (0)