Skip to content

Commit 98f17c3

Browse files
committed
Merge tag 'php-8.2.23' into was-8.2.x
Tag for php-8.2.23
2 parents b7a7493 + b56653c commit 98f17c3

File tree

96 files changed

+1675
-315
lines changed

Some content is hidden

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

96 files changed

+1675
-315
lines changed

.github/CODEOWNERS

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,53 @@
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

1117
/.github @iluuu1994 @TimWolla
1218
/build/gen_stub.php @kocsismate
13-
/ext/bcmath @Girgias
19+
/ext/bcmath @Girgias @nielsdos @SakiTakamachi
1420
/ext/curl @adoy
1521
/ext/date @derickr
1622
/ext/dba @Girgias
1723
/ext/dom @nielsdos
1824
/ext/ffi @dstogov
25+
/ext/gd @devnexen
1926
/ext/gettext @devnexen
2027
/ext/gmp @Girgias
2128
/ext/imap @Girgias
2229
/ext/intl @devnexen
2330
/ext/json @bukka
2431
/ext/libxml @nielsdos
25-
/ext/mbstring @alexdowad
32+
/ext/mbstring @alexdowad @youkidearitai
33+
/ext/mysqlnd @SakiTakamachi
2634
/ext/odbc @NattyNarwhal
2735
/ext/opcache @dstogov @iluuu1994
2836
/ext/openssl @bukka
29-
/ext/pdo_odbc @NattyNarwhal
30-
/ext/pdo_pgsql @devnexen
37+
/ext/pcntl @devnexen
38+
/ext/pdo @SakiTakamachi
39+
/ext/pdo_dblib @SakiTakamachi
40+
/ext/pdo_firebird @SakiTakamachi
41+
/ext/pdo_mysql @SakiTakamachi
42+
/ext/pdo_odbc @NattyNarwhal @SakiTakamachi
43+
/ext/pdo_pgsql @devnexen @SakiTakamachi
44+
/ext/pdo_sqlite @SakiTakamachi
3145
/ext/pgsql @devnexen
3246
/ext/random @TimWolla @zeriyoshi
3347
/ext/session @Girgias
48+
/ext/simplexml @nielsdos
3449
/ext/sockets @devnexen
3550
/ext/spl @Girgias
3651
/ext/standard @bukka
52+
/ext/xml @nielsdos
3753
/ext/xmlreader @nielsdos
54+
/ext/xmlwriter @nielsdos
3855
/ext/xsl @nielsdos
3956
/main @bukka
4057
/sapi/fpm @bukka
@@ -44,6 +61,8 @@
4461
/Zend/zend_API.* @dstogov @iluuu1994
4562
/Zend/zend_call_stack.* @arnaud-lb
4663
/Zend/zend_closures.* @dstogov
64+
/Zend/zend_compile.* @iluuu1994
65+
/Zend/zend_enum.* @iluuu1994
4766
/Zend/zend_execute.* @dstogov @iluuu1994
4867
/Zend/zend_execute_API.c @dstogov @iluuu1994
4968
/Zend/zend_gc.* @dstogov @arnaud-lb

.github/actions/verify-generated-files/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ runs:
1212
ext/tokenizer/tokenizer_data_gen.php
1313
build/gen_stub.php -f
1414
build/gen_stub.php --generate-optimizer-info
15-
git add . -N && git diff --exit-code
15+
# Use the -a flag for a bug in git 2.46.0, which doesn't consider changed -diff files.
16+
git add . -N && git diff -a --exit-code

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ jobs:
657657
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
658658
PHP_BUILD_OBJ_DIR: C:\obj
659659
PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
660-
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
660+
PHP_BUILD_SDK_BRANCH: php-sdk-2.3.0
661661
PHP_BUILD_CRT: vs16
662662
PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
663663
THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}"

.github/workflows/push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
MYSQL_ROOT_PASSWORD: root
116116
steps:
117117
- name: git checkout
118-
uses: actions/checkout@v3
118+
uses: actions/checkout@v4
119119
- name: apt
120120
uses: ./.github/actions/apt-x32
121121
- name: ccache
@@ -182,7 +182,7 @@ jobs:
182182
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
183183
PHP_BUILD_OBJ_DIR: C:\obj
184184
PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
185-
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
185+
PHP_BUILD_SDK_BRANCH: php-sdk-2.3.0
186186
PHP_BUILD_CRT: vs16
187187
PLATFORM: x64
188188
THREAD_SAFE: "1"

NEWS

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
29 Aug 2024, PHP 8.2.23
4+
5+
- Core:
6+
. Fixed bug GH-15020 (Memory leak in Zend/Optimizer/escape_analysis.c).
7+
(nielsdos)
8+
. Fixed bug GH-15023 (Memory leak in Zend/zend_ini.c). (nielsdos)
9+
. Fixed bug GH-13330 (Append -Wno-implicit-fallthrough flag conditionally).
10+
(Peter Kokot)
11+
. Fix uninitialized memory in network.c. (nielsdos)
12+
. Fixed bug GH-15108 (Segfault when destroying generator during shutdown).
13+
(Arnaud)
14+
. Fixed bug GH-15275 (Crash during GC of suspended generator delegate).
15+
(Arnaud)
16+
17+
- Curl:
18+
. Fixed case when curl_error returns an empty string.
19+
(David Carlier)
20+
21+
- DOM:
22+
. Fix UAF when removing doctype and using foreach iteration. (nielsdos)
23+
24+
- FFI:
25+
. Fixed bug GH-14286 (ffi enum type (when enum has no name) make memory
26+
leak). (nielsdos, dstogov)
27+
28+
- Hash:
29+
. Fix crash when converting array data for array in shm in xxh3. (nielsdos)
30+
31+
- Intl:
32+
. Fixed bug GH-15087 (IntlChar::foldCase()'s $option is not optional). (cmb)
33+
34+
- Opcache:
35+
. Fixed bug GH-13817 (Segmentation fault for enabled observers after pass 4).
36+
(Bob)
37+
. Fixed bug GH-13775 (Memory leak possibly related to opcache SHM placement).
38+
(Arnaud, nielsdos)
39+
40+
- Output:
41+
. Fixed bug GH-15179 (Segmentation fault (null pointer dereference) in
42+
ext/standard/url_scanner_ex.re). (nielsdos)
43+
44+
- PDO_Firebird:
45+
. Fix bogus fallthrough path in firebird_handle_get_attribute(). (nielsdos)
46+
47+
- PHPDBG:
48+
. Fixed bug GH-13199 (EOF emits redundant prompt in phpdbg local console mode
49+
with libedit/readline). (Peter Kokot)
50+
. Fixed bug GH-15268 (heap buffer overflow in phpdbg
51+
(zend_hash_num_elements() Zend/zend_hash.h)). (nielsdos)
52+
. Fixed bug GH-15210 use-after-free on watchpoint allocations. (nielsdos)
53+
54+
- Soap:
55+
. Fixed bug #55639 (Digest autentication dont work). (nielsdos)
56+
. Fix SoapFault property destruction. (nielsdos)
57+
. Fixed bug GH-15252 (SOAP XML broken since PHP 8.3.9 when using classmap
58+
constructor option). (nielsdos)
59+
60+
- Standard:
61+
. Fix passing non-finite timeout values in stream functions. (nielsdos)
62+
. Fixed GH-14780 p(f)sockopen timeout overflow. (David Carlier)
63+
64+
- Streams:
65+
. Fixed bug GH-15028 (Memory leak in ext/phar/stream.c). (nielsdos)
66+
. Fixed bug GH-15034 (Integer overflow on stream_notification_callback
67+
byte_max parameter with files bigger than 2GB). (nielsdos)
68+
69+
- Tidy:
70+
. Fix memory leaks in ext/tidy basedir restriction code. (nielsdos)
71+
372
01 Aug 2024, PHP 8.2.22
473

574
- Core:
@@ -12,6 +81,8 @@ PHP NEWS
1281
. Fixed bug GH-14741 (Segmentation fault in Zend/zend_types.h). (nielsdos)
1382
. Fixed bug GH-14969 (Use-after-free in property coercion with __toString()).
1483
(ilutov)
84+
. Fixed bug GH-14961 (Comment between -> and keyword results in parse error).
85+
(ilutov)
1586

1687
- Dom:
1788
. Fixed bug GH-14702 (DOMDocument::xinclude() crash). (nielsdos)

Zend/Optimizer/compact_vars.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "Optimizer/zend_optimizer_internal.h"
2020
#include "zend_bitset.h"
21+
#include "zend_observer.h"
2122

2223
/* This pass removes all CVs and temporaries that are completely unused. It does *not* merge any CVs or TMPs.
2324
* This pass does not operate on SSA form anymore. */
@@ -117,7 +118,7 @@ void zend_optimizer_compact_vars(zend_op_array *op_array) {
117118
op_array->last_var = num_cvs;
118119
}
119120

120-
op_array->T = num_tmps;
121+
op_array->T = num_tmps + ZEND_OBSERVER_ENABLED; // reserve last temporary for observers if enabled
121122

122123
free_alloca(vars_map, use_heap2);
123124
}

Zend/Optimizer/escape_analysis.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *o
400400
}
401401

402402
if (zend_build_equi_escape_sets(ees, op_array, ssa) == FAILURE) {
403+
free_alloca(ees, use_heap);
403404
return FAILURE;
404405
}
405406

Zend/Optimizer/optimize_temp_vars_5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "zend_execute.h"
2828
#include "zend_vm.h"
2929
#include "zend_bitset.h"
30+
#include "zend_observer.h"
3031

3132
#define INVALID_VAR ((uint32_t)-1)
3233
#define GET_AVAILABLE_T() \
@@ -174,5 +175,5 @@ void zend_optimize_temporary_variables(zend_op_array *op_array, zend_optimizer_c
174175
}
175176

176177
zend_arena_release(&ctx->arena, checkpoint);
177-
op_array->T = max + 1;
178+
op_array->T = max + 1 + ZEND_OBSERVER_ENABLED; // reserve last temporary for observers if enabled
178179
}

Zend/Optimizer/zend_optimizer.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "zend_dump.h" // for zend_dump_op_array()
2929
#include "zend_inference.h" // for OP1_INFO(), ...
3030
#include "zend_ini.h"
31-
#include "zend_observer.h"
3231
#include "zend_virtual_cwd.h" //for IS_ABSOLUTE_PATH()
3332
#include "zend_vm.h"
3433

@@ -1096,8 +1095,6 @@ static void zend_revert_pass_two(zend_op_array *op_array)
10961095
}
10971096
#endif
10981097

1099-
op_array->T -= ZEND_OBSERVER_ENABLED;
1100-
11011098
op_array->fn_flags &= ~ZEND_ACC_DONE_PASS_TWO;
11021099
}
11031100

@@ -1127,8 +1124,6 @@ static void zend_redo_pass_two(zend_op_array *op_array)
11271124
}
11281125
#endif
11291126

1130-
op_array->T += ZEND_OBSERVER_ENABLED; // reserve last temporary for observers if enabled
1131-
11321127
opline = op_array->opcodes;
11331128
end = opline + op_array->last;
11341129
while (opline < end) {
@@ -1556,12 +1551,6 @@ ZEND_API void zend_optimize_script(zend_script *script, zend_long optimization_l
15561551
}
15571552
}
15581553

1559-
if (ZEND_OBSERVER_ENABLED) {
1560-
for (i = 0; i < call_graph.op_arrays_count; i++) {
1561-
++call_graph.op_arrays[i]->T; // ensure accurate temporary count for stack size precalculation
1562-
}
1563-
}
1564-
15651554
if (ZEND_OPTIMIZER_PASS_12 & optimization_level) {
15661555
for (i = 0; i < call_graph.op_arrays_count; i++) {
15671556
zend_adjust_fcall_stack_size_graph(call_graph.op_arrays[i]);
@@ -1577,8 +1566,6 @@ ZEND_API void zend_optimize_script(zend_script *script, zend_long optimization_l
15771566
zend_recalc_live_ranges(op_array, needs_live_range);
15781567
}
15791568
} else {
1580-
op_array->T -= ZEND_OBSERVER_ENABLED; // redo_pass_two will re-increment it
1581-
15821569
zend_redo_pass_two(op_array);
15831570
if (op_array->live_range) {
15841571
zend_recalc_live_ranges(op_array, NULL);

Zend/tests/gh14961.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
GH-14961: Comment between -> and keyword
3+
--FILE--
4+
<?php
5+
6+
class C {
7+
public $class = C::class;
8+
}
9+
10+
$c = new C();
11+
$c->/* comment */class = 42;
12+
var_dump($c->/** doc comment */class);
13+
var_dump($c->
14+
// line comment
15+
class);
16+
var_dump($c->
17+
# hash comment
18+
class);
19+
var_dump($c?->/* comment */class);
20+
21+
?>
22+
--EXPECT--
23+
int(42)
24+
int(42)
25+
int(42)
26+
int(42)

0 commit comments

Comments
 (0)