Skip to content

Commit 4e37984

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stream_select_unlimited
# Conflicts: # NEWS
2 parents e639977 + 7f1e8cb commit 4e37984

328 files changed

Lines changed: 31645 additions & 10498 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/sh
2+
set -ex
3+
cd "$(dirname "$0")/../../.."
4+
5+
tmp_dir=/tmp/php-src-download-bundled/jit-ir
6+
rm -rf "$tmp_dir"
7+
8+
revision=00bec1ca490b8bc51f636a42040c5e9f64c1a91b
9+
10+
git clone --depth 1 --revision="$revision" https://github.com/dstogov/ir.git "$tmp_dir"
11+
12+
rm -rf ext/opcache/jit/ir
13+
cp -R "$tmp_dir" ext/opcache/jit/ir
14+
15+
cd ext/opcache/jit/ir
16+
17+
# remove unneeded files
18+
rm -rf .git
19+
rm -r .github
20+
rm -r bench
21+
rm -r examples
22+
rm -r tests
23+
rm -r tools
24+
rm -r fuzz
25+
rm README.md
26+
rm TODO
27+
rm ir.g
28+
rm ir_cpuinfo.c
29+
rm ir_emit_c.c
30+
rm ir_emit_llvm.c
31+
rm ir_load.c
32+
rm ir_load_llvm.c
33+
rm ir_main.c
34+
rm ir_mem2ssa.c
35+
36+
# add extra files
37+
git restore README

‎.github/workflows/verify-bundled-files.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths: &paths
66
- '.github/scripts/download-bundled/**'
77
- 'Zend/asm/**'
8+
- 'ext/opcache/jit/ir/**'
89
- 'ext/pcre/pcre2lib/**'
910
- 'ext/uri/uriparser/**'
1011
pull_request:
@@ -34,6 +35,9 @@ jobs:
3435
'boost-context':
3536
- '.github/scripts/download-bundled/boost-context.*'
3637
- 'Zend/asm/**'
38+
'jit-ir':
39+
- '.github/scripts/download-bundled/jit-ir.*'
40+
- 'ext/opcache/jit/ir/**'
3741
pcre2:
3842
- '.github/scripts/download-bundled/pcre2.*'
3943
- 'ext/pcre/pcre2lib/**'
@@ -50,6 +54,15 @@ jobs:
5054
echo "::group::Verify files"
5155
.github/scripts/test-directory-unchanged.sh Zend/asm
5256
echo "::endgroup::"
57+
- name: 'JIT IR'
58+
if: ${{ !cancelled() && (steps.changes.outputs.jit-ir == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
59+
run: |
60+
echo "::group::Download"
61+
.github/scripts/download-bundled/jit-ir.sh
62+
echo "::endgroup::"
63+
echo "::group::Verify files"
64+
.github/scripts/test-directory-unchanged.sh 'ext/opcache/jit/ir'
65+
echo "::endgroup::"
5366
- name: PCRE2
5467
if: ${{ !cancelled() && (steps.changes.outputs.pcre2 == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
5568
run: |

‎NEWS‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,81 @@ PHP NEWS
66
. Use recommended TYPE, HELP order for OpenMetrics metadata.
77
(Marcel Hernandez)
88

9+
- Hash:
10+
. Fixed mhash_keygen_s2k() truncating a $length above INT_MAX instead of
11+
throwing a ValueError. (Marc Bennewitz)
12+
913
- Intl:
1014
. Fixed Collator attribute and strength methods not rejecting an
1115
unconstructed Collator. (Ilia Alshanetsky)
1216

17+
- Lexbor:
18+
. Merge patches lexbor/lexbor@8a14bc0 and lexbor/lexbor@f67ce4b, fixing a
19+
heap buffer overflow in :lexbor-contains() parsing and buffer overflows
20+
in malformed decode replay. (alexandre-daubois)
21+
22+
- MBString:
23+
. Fixed bug GH-23106 (mb_strpos() reads past the end of a haystack ending in
24+
a truncated UTF-8 sequence). (Lazizbek Ergashev)
25+
. Updated Unicode data tables to Unicode 18.0 (Yuya Hamada)
26+
. Fixed mbstring functions emitting surrogates in UTF-8 output and flagging
27+
it as valid UTF-8. (Nicolas Grekas)
28+
29+
- MySQLi:
30+
. Fix GH-22854: Fixed failed assertion when accessing mysqli property after
31+
failed reconnection. (Kamil Tekiela)
32+
33+
- Opcache:
34+
. Fixed bug GH-23693 (Tracing JIT produces wrong results for a guard on a
35+
loop-invariant addition). (Ilia Alshanetsky)
36+
. Fixed OSS-Fuzz #545352966 (default value AST of an SHM-persisted partial).
37+
(ndossche)
38+
39+
- PDO:
40+
. Fixed PDOStatement::getColumnMeta() reading out of bounds for an invalid
41+
column index. (Ilia Alshanetsky)
42+
. Fixed PDOStatement::bindColumn() registering a binding for a column name
43+
that is not in the result set. (Ilia Alshanetsky)
44+
. Fixed bug GH-23962 (Destroying a persistent PDO instance rolls back a
45+
transaction still in use by another instance). (Lazizbek Ergashev)
46+
47+
- PGSQL:
48+
. Fixed pg_lo_write() rejecting data containing null bytes. (Ilia Alshanetsky)
49+
50+
- Posix:
51+
. Reverted the validity check on the flags argument of posix_access().
52+
(David Carlier)
53+
54+
- Readline:
55+
. Fixed a heap over-read in the interactive shell prompt when cli.prompt is
56+
set to an empty string. (Ilia Alshanetsky)
57+
58+
- Session:
59+
. Fixed session_start() continuing after a failed create_sid() when
60+
session.use_strict_mode rejects the supplied ID. (Ilia Alshanetsky)
61+
. Fixed exceptions from user-defined create_sid() handlers being replaced
62+
by return-value validation errors. (Ilia Alshanetsky)
63+
64+
- SOAP:
65+
. Fixed the SOAP client accepting a response body shorter than its
66+
Content-Length and reusing the connection. (Ilia Alshanetsky)
67+
68+
- SPL:
69+
. Fixed bug GH-23385 (SplDoublyLinkedList::serialize() use-after-free when
70+
__serialize() removes an element). (David Carlier)
71+
72+
- SQLite:
73+
. Fixed a crash when SQLite3::close() is called from a userland callback.
74+
(Ilia Alshanetsky)
75+
1376
- Standard:
77+
. Fixed bug #60110 (fclose(), file_put_contents(), copy() do not return false
78+
properly). (Jakub Zelenka, Ilija Tovilo)
79+
. Fixed three Windows-only proc_open() defects: an uninitialized
80+
PROCESS_INFORMATION, an indeterminate comspec pointer after a failed
81+
lookup, and an unchecked CreateFileA() failure. (Ilia Alshanetsky)
82+
. Fix persistent stream context lifetime during shutdown (Levi Morrison)
83+
. Fixed bug GH-23780 (unserialize('') fails silently). (timwolla)
1484
. Fixed stream_select() aborting the whole call once any watched stream's
1585
descriptor exceeded FD_SETSIZE; it no longer imposes that limit, so watching
1686
many descriptors no longer requires rebuilding with --enable-fd-setsize.
@@ -22,5 +92,15 @@ PHP NEWS
2292
handles; it now fails gracefully instead. (Frode Børli)
2393
. Improved performance of array_splice() when inserting without removing
2494
elements. (mehmetcansahin)
95+
. Enforce max_filter_count: limit the number of filters that can be chained
96+
in a php://filter URL. (Sjoerd Langkemper)
97+
98+
- URI:
99+
. Fix casing of enum cases in UriHostType and UrlHostType to match the RFC
100+
and PHP’s naming policy. (timwolla)
101+
102+
- Zlib:
103+
. Fixed inflate_init() dropping the preset dictionary for raw streams with
104+
a non-default window. (Ilia Alshanetsky)
25105

26106
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

‎UPGRADING‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ PHP 8.7 UPGRADE NOTES
1919
1. Backward Incompatible Changes
2020
========================================
2121

22+
- PDO:
23+
. PDOStatement::bindColumn() now throws a ValueError when the column name is
24+
not present in the result set. It previously reported the condition
25+
through PDO::ATTR_ERRMODE and returned false.
26+
27+
- Standard:
28+
. The number of filters that can be chained in a php://filter URL is limited
29+
to 16 by default. Set the stream context option max_filter_count to change
30+
this.
31+
2232
========================================
2333
2. New Features
2434
========================================

‎UPGRADING.INTERNALS‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,28 @@ PHP 8.7 INTERNALS UPGRADE NOTES
1717
- Removed zend_execute_scripts(). Manually call zend_execute_script() in a loop
1818
instead.
1919
- Removed ZEND_STATIC_ASSERT(). Use C11 static_assert() directly instead.
20+
- Removed zend_atomic.h and the zend_atomic_* types and functions.
21+
Use the standard C11 atomic_* types and functions instead.
22+
- The sapi_terminate_process() function was removed.
23+
- The sapi_force_http_10() function was removed.
24+
- The sapi_get_fd() function was removed.
25+
- The sapi_get_target_uid() and sapi_get_target_gid() functions were removed.
26+
- Removed HAVE_NORETURN and HAVE_NORETURN_ALIAS. ZEND_NORETURN is guaranteed to
27+
work.
28+
- Redefined ZEND_NORETURN to make use of the [[noreturn]] attribute for C++
29+
and C23, which means that ZEND_NORETURN needs to come first in the modifier
30+
list. Consider using noreturn (C11) / [[noreturn]] (C23) directly if
31+
header interoperability is not required.
2032

2133
========================
2234
2. Build system changes
2335
========================
2436

37+
- Windows build system changes:
38+
. C sources are now compiled as C17 and require C11 atomics. MSVC builds require
39+
Visual Studio 2026 or later and enable /experimental:c11atomics.
40+
. C++-only extension compiler flags can be added to CXXFLAGS_<EXTENSION>.
41+
2542
- Unix build system changes:
2643
. Autoconf minimum required version upgraded to 2.71.
2744

@@ -40,3 +57,9 @@ PHP 8.7 INTERNALS UPGRADE NOTES
4057
========================
4158
5. SAPI changes
4259
========================
60+
61+
- The size of the SAPI structure has changed.
62+
. The terminate_process method has been removed.
63+
. The force_http_10 method has been removed.
64+
. The get_fd method has been removed.
65+
. The get_target_uid and get_target_gid methods have been removed.

‎Zend/Optimizer/escape_analysis.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ static bool is_escape_use(const zend_op_array *op_array, const zend_ssa *ssa, in
297297
case ZEND_ASSIGN_STATIC_PROP_OP:
298298
case ZEND_ASSIGN_DIM:
299299
case ZEND_ASSIGN_OBJ:
300-
case ZEND_ASSIGN_OBJ_REF:
301300
break;
301+
case ZEND_ASSIGN_OBJ_REF:
302+
/* The property may now alias a variable outside of the object. */
303+
return true;
302304
case ZEND_PRE_INC_OBJ:
303305
case ZEND_PRE_DEC_OBJ:
304306
case ZEND_POST_INC_OBJ:

‎Zend/tests/fibers/gh23921.phpt‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
GH-23921 (Fibers start with error_reporting = 0 when the error_reporting INI directive is not set)
3+
--FILE--
4+
<?php
5+
echo error_reporting(), "\n";
6+
(new Fiber(function () {
7+
echo error_reporting(), "\n";
8+
echo $undefined;
9+
echo "after\n";
10+
}))->start();
11+
?>
12+
--EXPECTF--
13+
30719
14+
30719
15+
16+
Warning: Undefined variable $undefined in %s on line 5
17+
after
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Silence operator must not change the error_reporting value within the fiber
3+
--FILE--
4+
<?php
5+
6+
error_reporting(E_WARNING);
7+
8+
@(new Fiber(function () {
9+
var_dump(E_ALL);
10+
var_dump(E_WARNING);
11+
var_dump(error_reporting());
12+
}))->start();
13+
14+
?>
15+
--EXPECT--
16+
int(30719)
17+
int(2)
18+
int(2)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
--TEST--
2+
PFA in constexpr: binding a by-reference parameter
3+
--FILE--
4+
<?php
5+
6+
function byRef($a, &$b) {}
7+
function byRefVariadic(&...$args) {}
8+
9+
class C {
10+
public static function staticByRef($a, &$b) {}
11+
}
12+
13+
function f1($x = byRef(new stdClass, new stdClass, ...)) {}
14+
function f2($x = byRef(b: new stdClass, a: ?)) {}
15+
function f3($x = byRefVariadic(new stdClass, ...)) {}
16+
function f4($x = byRefVariadic(extra: new stdClass, ...)) {}
17+
function f5($x = C::staticByRef(new stdClass, new stdClass, ...)) {}
18+
19+
foreach (['f1', 'f2', 'f3', 'f4', 'f5'] as $f) {
20+
try {
21+
$f();
22+
} catch (Error $e) {
23+
echo get_class($e), ": ", $e->getMessage(), "\n";
24+
}
25+
}
26+
27+
function f6($x = byRef(new stdClass, ?)) {
28+
return $x;
29+
}
30+
31+
$partial = f6();
32+
$var = 1;
33+
var_dump($partial instanceof Closure);
34+
$partial($var);
35+
36+
?>
37+
--EXPECT--
38+
Error: byRef(): Argument #2 ($b) could not be passed by reference
39+
Error: byRef(): Argument #2 ($b) could not be passed by reference
40+
Error: byRefVariadic(): Argument #1 could not be passed by reference
41+
Error: byRefVariadic(): Argument #1 could not be passed by reference
42+
Error: C::staticByRef(): Argument #2 ($b) could not be passed by reference
43+
bool(true)

‎Zend/zend.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ ZEND_COLD void zenderror(const char *error) /* {{{ */
12641264
}
12651265
/* }}} */
12661266

1267-
ZEND_API ZEND_COLD ZEND_NORETURN void _zend_bailout(const char *filename, uint32_t lineno) /* {{{ */
1267+
ZEND_NORETURN ZEND_API ZEND_COLD void _zend_bailout(const char *filename, uint32_t lineno) /* {{{ */
12681268
{
12691269

12701270
if (!EG(bailout)) {
@@ -1715,7 +1715,7 @@ ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...)
17151715
zend_error_impl(type, format);
17161716
}
17171717

1718-
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(
1718+
ZEND_NORETURN ZEND_API ZEND_COLD void zend_error_at_noreturn(
17191719
int type, zend_string *filename, uint32_t lineno, const char *format, ...)
17201720
{
17211721
va_list args;
@@ -1744,17 +1744,17 @@ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(
17441744
abort(); \
17451745
} while (0)
17461746

1747-
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...)
1747+
ZEND_NORETURN ZEND_API ZEND_COLD void zend_error_noreturn(int type, const char *format, ...)
17481748
{
17491749
zend_error_noreturn_impl(type, format);
17501750
}
17511751

1752-
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn_unchecked(int type, const char *format, ...)
1752+
ZEND_NORETURN ZEND_API ZEND_COLD void zend_error_noreturn_unchecked(int type, const char *format, ...)
17531753
{
17541754
zend_error_noreturn_impl(type, format);
17551755
}
17561756

1757-
ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn(int type, int errn, const char *message)
1757+
ZEND_NORETURN ZEND_API ZEND_COLD void zend_strerror_noreturn(int type, int errn, const char *message)
17581758
{
17591759
#ifdef HAVE_STRERROR_R
17601760
char b[1024];

0 commit comments

Comments
 (0)