Skip to content

Commit b8bc409

Browse files
committed
Merge tag 'php-8.3.2' into was-8.3.x
Tag for php-8.3.2
2 parents 81ea894 + 7ea7406 commit b8bc409

File tree

93 files changed

+3147
-1756
lines changed

Some content is hidden

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

93 files changed

+3147
-1756
lines changed

NEWS

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,85 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
21 Dec 2023, PHP 8.3.1
3+
18 Jan 2024, PHP 8.3.2
4+
5+
- Core:
6+
. Fixed bug GH-12953 (false positive SSA integrity verification failed when
7+
loading composer classmaps with more than 11k elements). (nielsdos)
8+
. Fixed bug GH-12999 (zend_strnlen build when strnlen is unsupported).
9+
(rainerjung)
10+
. Fixed bug GH-12966 (missing cross-compiling 3rd argument so Autoconf
11+
doesn't emit warnings). (Peter Kokot)
12+
. Fixed bug GH-12854 (8.3 - as final trait-used method does not correctly
13+
report visibility in Reflection). (nielsdos)
14+
15+
- Cli:
16+
. Fix incorrect timeout in built-in web server when using router script and
17+
max_input_time. (ilutov)
18+
19+
- DOM:
20+
. Fixed bug GH-12870 (Creating an xmlns attribute results in a DOMException).
21+
(nielsdos)
22+
. Fix crash when toggleAttribute() is used without a document. (nielsdos)
23+
. Fix crash in adoptNode with attribute references. (nielsdos)
24+
. Fixed bug GH-13012 (DOMNode::isEqualNode() is incorrect when attribute
25+
order is different). (nielsdos)
26+
27+
- FFI:
28+
. Fixed bug GH-9698 (stream_wrapper_register crashes with FFI\CData).
29+
(Jakub Zelenka)
30+
. Fixed bug GH-12905 (FFI::new interacts badly with observers). (nielsdos)
31+
32+
- Intl:
33+
. Fixed GH-12943 (IntlDateFormatter::__construct accepts 'C' as valid locale).
34+
(David Carlier)
35+
36+
- Hash:
37+
. Fixed bug GH-12936 (hash() function hangs endlessly if using sha512 on
38+
strings >= 4GiB). (nielsdos)
39+
40+
- ODBC:
41+
. Fix crash on Apache shutdown with persistent connections. (nielsdos)
42+
43+
- Opcache:
44+
. Fixed oss-fuzz #64727 (JIT undefined array key warning may overwrite DIM
45+
with NULL when DIM is the same var as result). (ilutov)
46+
. Added workaround for SELinux mprotect execheap issue.
47+
See https://bugzilla.kernel.org/show_bug.cgi?id=218258. (ilutov)
48+
49+
- OpenSSL:
50+
. Fixed bug GH-12987 (openssl_csr_sign might leak new cert on error).
51+
(Jakub Zelenka)
52+
53+
- PDO:
54+
. Fix GH-12969 (Fixed PDO::getAttribute() to get PDO::ATTR_STRINGIFY_FETCHES).
55+
(SakiTakamachi)
56+
57+
- PDO_ODBC:
58+
. Fixed bug GH-12767 (Unable to turn on autocommit mode with setAttribute()).
59+
(SakiTakamachi)
60+
61+
- PGSQL:
62+
. Fixed auto_reset_persistent handling and allow_persistent type. (David Carlier)
63+
. Fixed bug GH-12974 (Apache crashes on shutdown when using pg_pconnect()).
64+
(nielsdos)
65+
66+
- Phar:
67+
. Fixed bug #77432 (Segmentation fault on including phar file). (nielsdos)
68+
69+
- PHPDBG:
70+
. Fixed bug GH-12962 (Double free of init_file in phpdbg_prompt.c). (nielsdos)
71+
72+
- SimpleXML:
73+
. Fix getting the address of an uninitialized property of a SimpleXMLElement
74+
resulting in a crash. (nielsdos)
75+
. Fixed bug GH-12929 (SimpleXMLElement with stream_wrapper_register can
76+
segfault). (nielsdos)
77+
78+
- Tidy:
79+
. Fixed bug GH-12980 (tidynode.props.attribute is missing
80+
"Boolean Attributes" and empty attributes). (nielsdos)
81+
82+
07 Dec 2023, PHP 8.3.1RC1
483

584
- Core:
685
. Fixed bug GH-12758 / GH-12768 (Invalid opline in OOM handlers within

Zend/Optimizer/ssa_integrity.c

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void ssa_verify_integrity(zend_op_array *op_array, zend_ssa *ssa, const char *ex
122122
/* Vars */
123123
for (i = 0; i < ssa->vars_count; i++) {
124124
zend_ssa_var *var = &ssa->vars[i];
125-
int use, c;
125+
int use;
126126
uint32_t type = ssa->var_info[i].type;
127127

128128
if (var->definition < 0 && !var->definition_phi && i > op_array->last_var) {
@@ -148,23 +148,45 @@ void ssa_verify_integrity(zend_op_array *op_array, zend_ssa *ssa, const char *ex
148148
}
149149
}
150150

151-
c = 0;
152-
FOREACH_USE(var, use) {
153-
if (++c > 10000) {
151+
/* Floyd's cycle detection algorithm, applied for use chain. */
152+
use = var->use_chain;
153+
int second_use = use;
154+
while (use >= 0 && second_use >= 0) {
155+
use = zend_ssa_next_use(ssa->ops, var - ssa->vars, use);
156+
second_use = zend_ssa_next_use(ssa->ops, var - ssa->vars, second_use);
157+
if (second_use < 0) {
158+
break;
159+
}
160+
second_use = zend_ssa_next_use(ssa->ops, var - ssa->vars, second_use);
161+
if (use == second_use) {
154162
FAIL("cycle in uses of " VARFMT "\n", VAR(i));
155163
goto finish;
156164
}
165+
}
166+
167+
FOREACH_USE(var, use) {
157168
if (!is_used_by_op(ssa, use, i)) {
158169
fprintf(stderr, "var " VARFMT " not in uses of op %d\n", VAR(i), use);
159170
}
160171
} FOREACH_USE_END();
161172

162-
c = 0;
163-
FOREACH_PHI_USE(var, phi) {
164-
if (++c > 10000) {
173+
/* Floyd's cycle detection algorithm, applied for phi nodes. */
174+
phi = var->phi_use_chain;
175+
zend_ssa_phi *second_phi = phi;
176+
while (phi && second_phi) {
177+
phi = zend_ssa_next_use_phi(ssa, var - ssa->vars, phi);
178+
second_phi = zend_ssa_next_use_phi(ssa, var - ssa->vars, second_phi);
179+
if (!second_phi) {
180+
break;
181+
}
182+
second_phi = zend_ssa_next_use_phi(ssa, var - ssa->vars, second_phi);
183+
if (phi == second_phi) {
165184
FAIL("cycle in phi uses of " VARFMT "\n", VAR(i));
166185
goto finish;
167186
}
187+
}
188+
189+
FOREACH_PHI_USE(var, phi) {
168190
if (!is_in_phi_sources(ssa, phi, i)) {
169191
FAIL("var " VARFMT " not in phi sources of %d\n", VAR(i), phi->ssa_var);
170192
}

Zend/Optimizer/zend_inference.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2830,8 +2830,15 @@ static zend_always_inline zend_result _zend_update_type_info(
28302830
/* DOUBLE may be auto-converted to LONG */
28312831
tmp |= MAY_BE_LONG;
28322832
tmp &= ~MAY_BE_DOUBLE;
2833+
} else if ((t1 & (MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING)) == MAY_BE_STRING
2834+
&& (tmp & (MAY_BE_LONG|MAY_BE_DOUBLE))) {
2835+
/* LONG/DOUBLE may be auto-converted to STRING */
2836+
tmp |= MAY_BE_STRING;
2837+
tmp &= ~(MAY_BE_LONG|MAY_BE_DOUBLE);
28332838
}
28342839
tmp &= t1;
2840+
} else {
2841+
tmp |= MAY_BE_LONG | MAY_BE_STRING;
28352842
}
28362843
} else if (opline->opcode == ZEND_ASSIGN_STATIC_PROP_OP) {
28372844
/* The return value must also satisfy the property type */
@@ -2842,8 +2849,15 @@ static zend_always_inline zend_result _zend_update_type_info(
28422849
/* DOUBLE may be auto-converted to LONG */
28432850
tmp |= MAY_BE_LONG;
28442851
tmp &= ~MAY_BE_DOUBLE;
2852+
} else if ((t1 & (MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING)) == MAY_BE_STRING
2853+
&& (tmp & (MAY_BE_LONG|MAY_BE_DOUBLE))) {
2854+
/* LONG/DOUBLE may be auto-converted to STRING */
2855+
tmp |= MAY_BE_STRING;
2856+
tmp &= ~(MAY_BE_LONG|MAY_BE_DOUBLE);
28452857
}
28462858
tmp &= t1;
2859+
} else {
2860+
tmp |= MAY_BE_LONG | MAY_BE_STRING;
28472861
}
28482862
} else {
28492863
if (tmp & MAY_BE_REF) {

Zend/Optimizer/zend_optimizer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,9 @@ zend_class_entry *zend_optimizer_get_class_entry(
798798
}
799799

800800
ce = zend_hash_find_ptr(CG(class_table), lcname);
801-
if (ce && ce->type == ZEND_INTERNAL_CLASS) {
801+
if (ce
802+
&& (ce->type == ZEND_INTERNAL_CLASS
803+
|| (op_array && ce->info.user.filename == op_array->filename))) {
802804
return ce;
803805
}
804806

Zend/tests/stack_limit/stack_limit_001.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ array(4) {
7676
["EG(stack_limit)"]=>
7777
string(%d) "0x%x"
7878
}
79-
Maximum call stack size of %d bytes reached. Infinite recursion?
80-
Maximum call stack size of %d bytes reached. Infinite recursion?
81-
Maximum call stack size of %d bytes reached. Infinite recursion?
82-
Maximum call stack size of %d bytes reached. Infinite recursion?
79+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
80+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
81+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
82+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?

Zend/tests/stack_limit/stack_limit_002.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ array(4) {
7979
["EG(stack_limit)"]=>
8080
string(%d) "0x%x"
8181
}
82-
Maximum call stack size of %d bytes reached. Infinite recursion?
83-
Maximum call stack size of %d bytes reached. Infinite recursion?
84-
Maximum call stack size of %d bytes reached. Infinite recursion?
85-
Maximum call stack size of %d bytes reached. Infinite recursion?
82+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
83+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
84+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
85+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?

Zend/tests/stack_limit/stack_limit_003.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_
77
--EXTENSIONS--
88
zend_test
99
--INI--
10-
zend.max_allowed_stack_size=128K
10+
zend.max_allowed_stack_size=256K
1111
--FILE--
1212
<?php
1313

@@ -61,6 +61,6 @@ array(4) {
6161
["EG(stack_limit)"]=>
6262
string(%d) "0x%x"
6363
}
64-
Maximum call stack size of %d bytes reached. Infinite recursion?
65-
Maximum call stack size of %d bytes reached. Infinite recursion?
66-
Maximum call stack size of %d bytes reached. Infinite recursion?
64+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
65+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
66+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?

Zend/tests/stack_limit/stack_limit_005.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ $test
6565
;
6666

6767
--EXPECTF--
68-
Fatal error: Maximum call stack size of %d bytes reached during compilation. Try splitting expression in %s on line %d
68+
Fatal error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached during compilation. Try splitting expression in %s on line %d

Zend/tests/stack_limit/stack_limit_006.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,6 @@ array(4) {
320320
["EG(stack_limit)"]=>
321321
string(%d) "0x%x"
322322
}
323-
Maximum call stack size of %d bytes reached. Infinite recursion?
324-
Maximum call stack size of %d bytes reached. Infinite recursion?
325-
Maximum call stack size of %d bytes reached. Infinite recursion?
323+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
324+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
325+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?

Zend/tests/stack_limit/stack_limit_007.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (!function_exists('zend_test_zend_call_stack_get')) die("skip zend_test_zend_
77
--EXTENSIONS--
88
zend_test
99
--INI--
10-
zend.max_allowed_stack_size=128K
10+
zend.max_allowed_stack_size=256K
1111
--FILE--
1212
<?php
1313

@@ -41,5 +41,5 @@ array(4) {
4141
["EG(stack_limit)"]=>
4242
string(%d) "0x%x"
4343
}
44-
Maximum call stack size of %d bytes reached. Infinite recursion?
44+
Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?
4545
Try executed: 1

0 commit comments

Comments
 (0)