Skip to content

Commit f195fe6

Browse files
authored
Merge branch 'php:master' into true-async-api
2 parents 09947a1 + 8b61c49 commit f195fe6

File tree

192 files changed

+2643
-2258
lines changed

Some content is hidden

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

192 files changed

+2643
-2258
lines changed

.github/scripts/windows/build.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ if not exist "%SDK_RUNNER%" (
4141
exit /b 3
4242
)
4343

44-
cmd /c %SDK_RUNNER% -t .github\scripts\windows\build_task.bat
44+
for /f "delims=" %%T in ('call .github\scripts\windows\find-vs-toolset.bat %PHP_BUILD_CRT%') do set "VS_TOOLSET=%%T"
45+
echo Got VS Toolset %VS_TOOLSET%
46+
cmd /c %SDK_RUNNER% -s %VS_TOOLSET% -t .github\scripts\windows\build_task.bat
4547
if %errorlevel% neq 0 exit /b 3
4648

4749
exit /b 0
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
@echo off
2+
3+
setlocal enabledelayedexpansion
4+
5+
if "%~1"=="" (
6+
echo ERROR: Usage: %~nx0 [vc14^|vc15^|vs16^|vs17]
7+
exit /b 1
8+
)
9+
10+
set "toolsets_vc14=14.0"
11+
set "toolsets_vc15="
12+
set "toolsets_vs16="
13+
set "toolsets_vs17="
14+
15+
16+
for /f "usebackq tokens=*" %%I in (`vswhere.exe -latest -find "VC\Tools\MSVC"`) do set "MSVCDIR=%%I"
17+
18+
if not defined MSVCDIR (
19+
echo ERROR: could not locate VC\Tools\MSVC
20+
exit /b 1
21+
)
22+
23+
for /f "delims=" %%D in ('dir /b /ad "%MSVCDIR%"') do (
24+
for /f "tokens=1,2 delims=." %%A in ("%%D") do (
25+
set "maj=%%A" & set "min=%%B"
26+
if "!maj!"=="14" (
27+
if !min! LEQ 9 (
28+
set "toolsets_vc14=%%D"
29+
) else if !min! LEQ 19 (
30+
set "toolsets_vc15=%%D"
31+
) else if !min! LEQ 29 (
32+
set "toolsets_vs16=%%D"
33+
) else (
34+
set "toolsets_vs17=%%D"
35+
)
36+
)
37+
)
38+
)
39+
40+
set "KEY=%~1"
41+
set "VAR=toolsets_%KEY%"
42+
call set "RESULT=%%%VAR%%%"
43+
if defined RESULT (
44+
echo %RESULT%
45+
exit /b 0
46+
) else (
47+
echo ERROR: no toolset found for %KEY%
48+
exit /b 1
49+
)

.github/scripts/windows/test.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ if not exist "%SDK_RUNNER%" (
99
exit /b 3
1010
)
1111

12-
cmd /c %SDK_RUNNER% -t .github\scripts\windows\test_task.bat
12+
for /f "delims=" %%T in ('call .github\scripts\windows\find-vs-toolset.bat %PHP_BUILD_CRT%') do set "VS_TOOLSET=%%T"
13+
cmd /c %SDK_RUNNER% -s %VS_TOOLSET% -t .github\scripts\windows\test_task.bat
1314
if %errorlevel% neq 0 exit /b 3
1415

1516
exit /b 0

.github/workflows/root.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
ubuntu_version: ${{
5959
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
6060
|| '22.04' }}
61-
windows_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9) && '2022' || '2019' }}
61+
windows_version: '2022'
6262
skip_laravel: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}
6363
skip_symfony: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}
6464
skip_wordpress: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}

EXTENSIONS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ SINCE: 5.0
238238
-------------------------------------------------------------------------------
239239
EXTENSION: bcmath
240240
PRIMARY MAINTAINER: Andi Gutmans <[email protected]> (2000 - 2004)
241+
Saki Takamachi <[email protected]> (2024 - 2025)
241242
MAINTENANCE: Maintained
242243
STATUS: Working
243244
-------------------------------------------------------------------------------

NEWS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ PHP NEWS
5656
. Properly handle __debugInfo() returning an array reference. (nielsdos)
5757
. Properly handle reference return value from __toString(). (nielsdos)
5858
. Added the pipe (|>) operator. (crell)
59+
. Added support for `final` with constructor property promotion.
60+
(DanielEScherzer)
61+
. Do not use RTLD_DEEPBIND if dlmopen is available. (Daniil Gentili)
62+
. Make `clone()` a function. (timwolla, edorian)
5963

6064
- Curl:
6165
. Added curl_multi_get_handles(). (timwolla)
@@ -130,6 +134,9 @@ PHP NEWS
130134
- Output:
131135
. Fixed calculation of aligned buffer size. (cmb)
132136

137+
- PCNTL:
138+
. Extend pcntl_waitid with rusage parameter. (vrza)
139+
133140
- PCRE:
134141
. Upgraded to pre2lib from 10.44 to 10.45. (nielsdos)
135142
. Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options.
@@ -245,6 +252,10 @@ PHP NEWS
245252
- Sqlite:
246253
. Added Sqlite3Stmt::busy to check if a statement is still being executed.
247254
(David Carlier)
255+
. Added Sqlite3Stmt::explain to produce a explain query plan from
256+
the statement. (David Carlier)
257+
. Added Sqlite3Result::fetchAll to returns all results at once from a query.
258+
(David Carlier)
248259

249260
- Standard:
250261
. Fixed crypt() tests on musl when using --with-external-libcrypt
@@ -254,6 +265,10 @@ PHP NEWS
254265
. Added array_first() and array_last(). (nielsdos)
255266
. Fixed bug GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types).
256267
(nielsdos)
268+
. Fixed exit code handling of sendmail cmd and added warnings.
269+
(Jesse Hathaway)
270+
. Fixed bug GH-18897 (printf: empty precision is interpreted as precision 6,
271+
not as precision 0). (nielsdos)
257272

258273
- Streams:
259274
. Fixed bug GH-16889 (stream_select() timeout useless for pipes on Windows).

UPGRADING

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ PHP 8.5 UPGRADE NOTES
116116
. SplFileObject::fwrite's parameter $length is now nullable. The default
117117
value changed from 0 to null.
118118

119+
- Standard:
120+
. Using a printf-family function with a formatter that did not specify the
121+
precision previously incorrectly reset the precision instead of treating
122+
it as a precision of 0. See GH-18897.
123+
119124
========================================
120125
2. New Features
121126
========================================
@@ -146,6 +151,8 @@ PHP 8.5 UPGRADE NOTES
146151
RFC: https://wiki.php.net/rfc/attributes-on-constants
147152
. Added the pipe (|>) operator.
148153
RFC: https://wiki.php.net/rfc/pipe-operator-v3
154+
. Constructor property promotion can now be used for final properties.
155+
RFC: https://wiki.php.net/rfc/final_promotion
149156

150157
- Curl:
151158
. Added support for share handles that are persisted across multiple PHP
@@ -210,6 +217,17 @@ PHP 8.5 UPGRADE NOTES
210217
now have an optional $lang parameter.
211218
This support solves compatibility with .NET SOAP clients.
212219

220+
- Sqlite:
221+
. Added class constants Sqlite3Stmt::EXPLAIN_MODE_PREPARED,
222+
Sqlite3Stmt::EXPLAIN_MODE_EXPLAIN and
223+
Sqlite3Stmt::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN.
224+
225+
- Standard:
226+
. mail() now returns the actual sendmail error and detects if the sendmail
227+
process was terminated unexpectedly. In such cases, a warning is emitted
228+
and the function returns false. Previously, these errors were silently
229+
ignored. This change affects only the sendmail transport.
230+
213231
- XSL:
214232
. The $namespace argument of XSLTProcessor::getParameter(),
215233
XSLTProcessor::setParameter() and XSLTProcessor::removeParameter()
@@ -271,6 +289,8 @@ PHP 8.5 UPGRADE NOTES
271289

272290
- PCNTL:
273291
. pcntl_exec() now has a formal return type of false.
292+
. pcntl_waitid() takes an additional resource_usage argument to
293+
gather various platform specific metrics about the child process.
274294

275295
- PDO_PGSQL:
276296
. PDO::pgsqlCopyFromArray also supports inputs as Iterable.
@@ -356,6 +376,8 @@ PHP 8.5 UPGRADE NOTES
356376
. get_exception_handler() allows retrieving the current user-defined exception
357377
handler function.
358378
RFC: https://wiki.php.net/rfc/get-error-exception-handler
379+
. The clone language construct is now a function.
380+
RFC: https://wiki.php.net/rfc/clone_with_v2
359381

360382
- Curl:
361383
. curl_multi_get_handles() allows retrieving all CurlHandles current

UPGRADING.INTERNALS

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ PHP 8.5 INTERNALS UPGRADE NOTES
1717
- Core
1818
. PG(arg_separator).input and PG(arg_separator).output are now `zend_string*`
1919
instead of `char*`.
20+
. DL_LOAD now doesn't use RTLD_DEEPBIND deepbind anymore on platforms
21+
where dlmopen with LM_ID_NEWLM is available:
22+
this means shared library symbol isolation (if needed) must be enabled on
23+
the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM
24+
instead of dlopen.
25+
RTLD_DEEPBIND is still enabled when the Apache SAPI is in use.
2026

2127
- Zend
2228
. Added zend_safe_assign_to_variable_noref() function to safely assign
@@ -37,6 +43,8 @@ PHP 8.5 INTERNALS UPGRADE NOTES
3743
. Added the zend_update_exception_properties() function for instantiating
3844
Exception child classes. It updates the $message, $code, and $previous
3945
properties.
46+
. ZEND_IS_XDIGIT() macro was removed because it was unused and its name
47+
did not match its actual behavior.
4048

4149
========================
4250
2. Build system changes
@@ -49,12 +57,18 @@ PHP 8.5 INTERNALS UPGRADE NOTES
4957
without duplicate build rules. It is up to the SAPI maintainers to ensure
5058
that appropriate build rules are created.
5159

52-
- Linux build system changes
60+
- Unix build system changes
5361
. libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex lib64)
5462
configure options are used to ${libdir}/php (ex: /usr/lib64/php)
5563
. PHP_ODBC_CFLAGS, PHP_ODBC_LFLAGS, PHP_ODBC_LIBS, PHP_ODBC_TYPE preprocessor
5664
macros defined by ext/odbc are now defined in php_config.h instead of the
5765
build-defs.h header.
66+
. Autoconf macro PHP_AP_EXTRACT_VERSION has been removed.
67+
. Autoconf macro PHP_BUILD_THREAD_SAFE has been removed (set enable_zts
68+
manually).
69+
. Autoconf macro PHP_DEF_HAVE has been removed (use AC_DEFINE).
70+
. Autoconf macro PHP_OUTPUT has been removed (use AC_CONFIG_FILES).
71+
. Autoconf macro PHP_TEST_BUILD has been removed (use AC_* macros).
5872

5973
========================
6074
3. Module changes

Zend/Optimizer/zend_func_infos.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* This is a generated file, edit the .stub.php files instead. */
22

33
static const func_info_t func_infos[] = {
4+
F1("clone", MAY_BE_OBJECT),
45
F1("zend_version", MAY_BE_STRING),
56
FN("func_get_args", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY),
67
F1("get_class_vars", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
@@ -394,8 +395,6 @@ static const func_info_t func_infos[] = {
394395
F1("compact", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
395396
FN("array_fill", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY),
396397
F1("array_fill_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
397-
F1("array_replace", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
398-
F1("array_replace_recursive", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
399398
FN("array_keys", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING),
400399
FN("array_values", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
401400
F1("array_count_values", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG),
@@ -404,13 +403,8 @@ static const func_info_t func_infos[] = {
404403
F1("array_flip", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING),
405404
F1("array_change_key_case", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
406405
F1("array_intersect_key", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
407-
F1("array_intersect_ukey", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
408-
F1("array_intersect", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
409-
F1("array_uintersect", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
410406
F1("array_intersect_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
411407
F1("array_uintersect_assoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
412-
F1("array_intersect_uassoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
413-
F1("array_uintersect_uassoc", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
414408
F1("array_diff_key", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
415409
F1("array_diff_ukey", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),
416410
F1("array_udiff", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_OF_REF),

Zend/tests/assert/expect_015.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ assert(0 && ($a = function () {
183183
$x = $a ?? $b;
184184
[$a, $b, $c] = [1, 2 => 'x', 'z' => 'c'];
185185
@foo();
186-
$y = clone $x;
186+
$y = \clone($x);
187187
yield 1 => 2;
188188
yield from $x;
189189
}))

0 commit comments

Comments
 (0)