Skip to content

Commit 646e4b8

Browse files
David EllingsworthDavid Ellingsworth
David Ellingsworth
authored and
David Ellingsworth
committed
Merge branch 'master' into GH15093
2 parents 64b961e + a7bd911 commit 646e4b8

22 files changed

+179
-53
lines changed

NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PHP NEWS
66
. Fix GH-14978 (The xmlreader extension phpize build). (Peter Kokot)
77
. Throw Error exception when encountering recursion during comparison, rather
88
than fatal error. (ilutov)
9+
. Added missing cstddef include for C++ builds. (cmb)
910

1011
- BCMath:
1112
. Adjust bcround()'s $mode parameter to only accept the RoundingMode
@@ -42,13 +43,19 @@ PHP NEWS
4243
. pg_convert/pg_insert/pg_update/pg_delete ; regexes are now cached.
4344
(David Carlier)
4445

46+
- Random:
47+
. Fixed bug GH-15094 (php_random_default_engine() is not C++ conforming).
48+
(cmb)
49+
4550
- Standard:
4651
. Fix references in request_parse_body() options array. (nielsdos)
4752
. Add RoundingMode enum. (timwolla, saki)
4853

4954
- Tidy:
5055
. Failures in the constructor now throw exceptions rather than emitting
5156
warnings and having a broken object. (nielsdos)
57+
. Add tidyNode::getNextSibling() and tidyNode::getPreviousSibling().
58+
(nielsdos)
5259

5360
- XSL:
5461
. Fix trampoline leak in xpath callables. (nielsdos)

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@ PHP 8.4 UPGRADE NOTES
667667
array_any().
668668
RFC: https://wiki.php.net/rfc/array_find
669669

670+
- Tidy:
671+
. Added tidyNode::getNextSibling() and tidyNode::getPreviousSibling().
672+
670673
- XMLReader:
671674
. Added XMLReader::fromStream(), XMLReader::fromUri(), XMLReader::fromString().
672675
RFC: https://wiki.php.net/rfc/xmlreader_writer_streams

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/zend_portability.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,13 @@ extern "C++" {
791791
# define ZEND_STATIC_ASSERT(c, m)
792792
#endif
793793

794-
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */ \
795-
|| (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */
794+
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */
796795
typedef max_align_t zend_max_align_t;
796+
#elif (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */
797+
extern "C++" {
798+
# include <cstddef>
799+
}
800+
typedef std::max_align_t zend_max_align_t;
797801
#else
798802
typedef union {
799803
char c;

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ AC_CONFIG_SRCDIR([main/php_version.h])
2222
AC_CONFIG_AUX_DIR([build])
2323
AC_PRESERVE_HELP_ORDER
2424

25-
PHP_CONFIG_NICE(config.nice)
25+
PHP_CONFIG_NICE([config.nice])
2626

2727
PHP_CANONICAL_HOST_TARGET
2828

ext/dba/tests/dba_flatfile.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ bool(true)
2929
bool(true)
3030
Try to remove key 1 again
3131
bool(false)
32+
[key10]name10: Content String 10
33+
[key30]name30: Content String 30
3234
key2: Content String 2
3335
key4: Another Content String
3436
key5: The last content string
3537
name9: Content String 9
36-
[key10]name10: Content String 10
37-
[key30]name30: Content String 30
3838
Total keys: 6
3939
Key 1 exists? N
4040
Key 2 exists? Y

ext/dba/tests/dba_gdbm.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ bool(true)
3535
bool(true)
3636
Try to remove key 1 again
3737
bool(false)
38-
key4: Another Content String
38+
[key10]name10: Content String 10
39+
[key30]name30: Content String 30
3940
key2: Content String 2
41+
key4: Another Content String
4042
key5: The last content string
41-
[key10]name10: Content String 10
4243
name9: Content String 9
43-
[key30]name30: Content String 30
4444
Total keys: 6
4545
Key 1 exists? N
4646
Key 2 exists? Y
@@ -81,12 +81,12 @@ bool(true)
8181
bool(true)
8282
Try to remove key 1 again
8383
bool(false)
84-
key4: Another Content String
84+
[key10]name10: Content String 10
85+
[key30]name30: Content String 30
8586
key2: Content String 2
87+
key4: Another Content String
8688
key5: The last content string
87-
[key10]name10: Content String 10
8889
name9: Content String 9
89-
[key30]name30: Content String 30
9090
Total keys: 6
9191
Key 1 exists? N
9292
Key 2 exists? Y

ext/dba/tests/dba_inifile.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ bool(true)
3030
bool(true)
3131
Try to remove key 1 again
3232
bool(false)
33-
key2: Content String 2
34-
key4: Another Content String
35-
key5: The last content string
36-
name9: Content String 9
3733
[key10]:
3834
[key10]name10: Content String 10
3935
[key30]:
4036
[key30]name30: Content String 30
37+
key2: Content String 2
38+
key4: Another Content String
39+
key5: The last content string
40+
name9: Content String 9
4141
Total keys: 8
4242
Key 1 exists? N
4343
Key 2 exists? Y

ext/dba/tests/dba_ndbm.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ bool(true)
3636
bool(true)
3737
Try to remove key 1 again
3838
bool(false)
39-
key4: Another Content String
39+
[key10]name10: Content String 10
40+
[key30]name30: Content String 30
4041
key2: Content String 2
42+
key4: Another Content String
4143
key5: The last content string
42-
[key10]name10: Content String 10
4344
name9: Content String 9
44-
[key30]name30: Content String 30
4545
Total keys: 6
4646
Key 1 exists? N
4747
Key 2 exists? Y
@@ -82,12 +82,12 @@ bool(true)
8282
bool(true)
8383
Try to remove key 1 again
8484
bool(false)
85-
key4: Another Content String
85+
[key10]name10: Content String 10
86+
[key30]name30: Content String 30
8687
key2: Content String 2
88+
key4: Another Content String
8789
key5: The last content string
88-
[key10]name10: Content String 10
8990
name9: Content String 9
90-
[key30]name30: Content String 30
9191
Total keys: 6
9292
Key 1 exists? N
9393
Key 2 exists? Y

ext/dba/tests/dba_qdbm.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ bool(true)
3535
bool(true)
3636
Try to remove key 1 again
3737
bool(false)
38+
[key10]name10: Content String 10
39+
[key30]name30: Content String 30
3840
key2: Content String 2
3941
key4: Another Content String
4042
key5: The last content string
4143
name9: Content String 9
42-
[key10]name10: Content String 10
43-
[key30]name30: Content String 30
4444
Total keys: 6
4545
Key 1 exists? N
4646
Key 2 exists? Y
@@ -81,12 +81,12 @@ bool(true)
8181
bool(true)
8282
Try to remove key 1 again
8383
bool(false)
84+
[key10]name10: Content String 10
85+
[key30]name30: Content String 30
8486
key2: Content String 2
8587
key4: Another Content String
8688
key5: The last content string
8789
name9: Content String 9
88-
[key10]name10: Content String 10
89-
[key30]name30: Content String 30
9090
Total keys: 6
9191
Key 1 exists? N
9292
Key 2 exists? Y

ext/dba/tests/dba_tcadb.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ bool(true)
3030
bool(true)
3131
Try to remove key 1 again
3232
bool(false)
33+
[key10]name10: Content String 10
34+
[key30]name30: Content String 30
3335
key2: Content String 2
3436
key4: Another Content String
3537
key5: The last content string
3638
name9: Content String 9
37-
[key10]name10: Content String 10
38-
[key30]name30: Content String 30
3939
Total keys: 6
4040
Key 1 exists? N
4141
Key 2 exists? Y

ext/dba/tests/setup/setup_dba_tests.inc

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,29 @@ function run_standard_tests_ex(string $handler, string $name, LockFlag $lock, bo
102102
echo 'Try to remove key 1 again', \PHP_EOL;
103103
var_dump(dba_delete("key1", $db_writer));
104104

105-
// Fetch data
105+
// Fetch and sort data. We sort to guarantee that the output is
106+
// consistent across invocations and architectures. When iterating
107+
// with firstkey() and nextkey(), several engines (GDBM, LMDB,
108+
// QDBM) make no promise about the iteration order. Others (TCADB,
109+
// DBM) explicitly state that the order is arbitrary. With GDBM at
110+
// least, the order appears platform-dependent -- we have a report
111+
// in Github issue 14786. GDBM's own test suite sorts this output,
112+
// suggesting that sorting is a reasonable workaround for the issue.
113+
$output = [];
114+
106115
$key = dba_firstkey($db_writer);
107116
$total_keys = 0;
108117
while ($key) {
109-
echo $key, ': ', dba_fetch($key, $db_writer), \PHP_EOL;
118+
$output[] = $key . ': ' . dba_fetch($key, $db_writer) . \PHP_EOL;
110119
$key = dba_nextkey($db_writer);
111120
$total_keys++;
112121
}
122+
123+
sort($output, SORT_STRING);
124+
foreach ($output as $line) {
125+
echo $line;
126+
}
127+
113128
echo 'Total keys: ', $total_keys, \PHP_EOL;
114129
for ($i = 1; $i < 6; $i++) {
115130
echo "Key $i exists? ", dba_exists("key$i", $db_writer) ? 'Y' : 'N', \PHP_EOL;

ext/filter/config.w32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ ARG_ENABLE("filter", "Filter Support", "yes");
44

55
if (PHP_FILTER == "yes") {
66
EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c", PHP_FILTER_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
7+
ADD_EXTENSION_DEP('filter', 'pcre');
78
PHP_INSTALL_HEADERS("ext/filter", "php_filter.h");
89
}

ext/mbstring/config.m4

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ AC_DEFUN([PHP_MBSTRING_ADD_CFLAG], [
1818
PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS $1"
1919
])
2020

21-
AC_DEFUN([PHP_MBSTRING_ADD_INSTALL_HEADERS], [
22-
PHP_MBSTRING_INSTALL_HEADERS="$PHP_MBSTRING_INSTALL_HEADERS $1"
23-
])
24-
2521
AC_DEFUN([PHP_MBSTRING_EXTENSION], [
2622
PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_BASE_SOURCES $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
2723
PHP_SUBST([MBSTRING_SHARED_LIBADD])
@@ -45,8 +41,7 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
4541
#include "$out"
4642
EOF
4743
48-
PHP_MBSTRING_ADD_INSTALL_HEADERS([mbstring.h])
49-
PHP_INSTALL_HEADERS([ext/mbstring], [$PHP_MBSTRING_INSTALL_HEADERS])
44+
PHP_INSTALL_HEADERS([ext/mbstring], [mbstring.h])
5045
])
5146

5247
AC_DEFUN([PHP_MBSTRING_SETUP_MBREGEX], [
@@ -80,7 +75,7 @@ AC_DEFUN([PHP_MBSTRING_SETUP_MBREGEX], [
8075
AC_DEFINE([HAVE_MBREGEX], 1, [whether to have multibyte regex support])
8176
8277
PHP_MBSTRING_ADD_BASE_SOURCES([php_mbregex.c])
83-
PHP_MBSTRING_ADD_INSTALL_HEADERS([php_mbregex.h php_onig_compat.h])
78+
PHP_INSTALL_HEADERS([ext/mbstring], [php_mbregex.h php_onig_compat.h])
8479
fi
8580
])
8681

@@ -133,7 +128,23 @@ AC_DEFUN([PHP_MBSTRING_SETUP_LIBMBFL], [
133128
libmbfl/nls/nls_tr.c
134129
libmbfl/nls/nls_ua.c
135130
])
136-
PHP_MBSTRING_ADD_INSTALL_HEADERS([libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h])
131+
132+
PHP_INSTALL_HEADERS([ext/mbstring], m4_normalize([
133+
libmbfl/config.h
134+
libmbfl/mbfl/eaw_table.h
135+
libmbfl/mbfl/mbfilter_8bit.h
136+
libmbfl/mbfl/mbfilter_pass.h
137+
libmbfl/mbfl/mbfilter_wchar.h
138+
libmbfl/mbfl/mbfilter.h
139+
libmbfl/mbfl/mbfl_consts.h
140+
libmbfl/mbfl/mbfl_convert.h
141+
libmbfl/mbfl/mbfl_defs.h
142+
libmbfl/mbfl/mbfl_encoding.h
143+
libmbfl/mbfl/mbfl_filter_output.h
144+
libmbfl/mbfl/mbfl_language.h
145+
libmbfl/mbfl/mbfl_memory_device.h
146+
libmbfl/mbfl/mbfl_string.h
147+
]))
137148
])
138149

139150
dnl

ext/opcache/jit/zend_jit_ir.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7335,6 +7335,9 @@ static int zend_jit_identical(zend_jit_ctx *jit,
73357335
}
73367336
op2_addr = real_addr;
73377337
}
7338+
if (may_throw) {
7339+
jit_SET_EX_OPLINE(jit, opline);
7340+
}
73387341

73397342
ref = ir_CALL_2(IR_BOOL, ir_CONST_FC_FUNC(zend_is_identical),
73407343
jit_ZVAL_ADDR(jit, op1_addr),

ext/pgsql/tests/80_bug14383.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ bool(true)
3939
bool(true)
4040
Try to remove key 1 again
4141
bool(false)
42+
[key10]name10: Content String 10
43+
[key30]name30: Content String 30
4244
key2: Content String 2
4345
key4: Another Content String
4446
key5: The last content string
4547
name9: Content String 9
46-
[key10]name10: Content String 10
47-
[key30]name30: Content String 30
4848
Total keys: 6
4949
Key 1 exists? N
5050
Key 2 exists? Y

ext/random/php_random.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ PHPAPI void *php_random_default_status(void);
167167

168168
static inline php_random_algo_with_state php_random_default_engine(void)
169169
{
170-
return (php_random_algo_with_state){
171-
.algo = php_random_default_algo(),
172-
.state = php_random_default_status(),
173-
};
170+
php_random_algo_with_state raws;
171+
raws.algo = php_random_default_algo();
172+
raws.state = php_random_default_status();
173+
return raws;
174174
}
175175

176176
PHPAPI zend_string *php_random_bin2hex_le(const void *ptr, const size_t len);

0 commit comments

Comments
 (0)