Skip to content

Commit 5819e1e

Browse files
authored
Merge branch 'php:master' into true-async
2 parents 6c000f9 + 114fc16 commit 5819e1e

Some content is hidden

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

61 files changed

+637
-775
lines changed

.github/labeler.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@
469469
- 'ext/pdo/php_pdo.h'
470470
- 'ext/pdo/php_pdo_driver.h'
471471
- 'ext/pdo/php_pdo_error.h'
472-
- 'ext/phar/php_phar.h'
473472
- 'ext/random/php_random.h'
474473
- 'ext/random/php_random_csprng.h'
475474
- 'ext/random/php_random_uint128.h'

NEWS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,21 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.5.0alpha2
44

5+
- Core:
6+
. Fix OSS-Fuzz #427814452 (pipe compilation fails with assert).
7+
(nielsdos, ilutov)
8+
9+
- DOM:
10+
. Make cloning DOM node lists, maps, and collections fail. (nielsdos)
11+
12+
- PDO_ODBC
13+
. Fetch larger block sizes and better handle SQL_NO_TOTAL when calling
14+
SQLGetData. (Calvin Buckley, Saki Takamachi)
15+
516
- Standard:
617
. Optimized pack(). (nielsdos, divinity76)
18+
. Fixed bug GH-19070 (setlocale($type, NULL) should not be deprecated).
19+
(nielsdos)
720

821
- URI:
922
. Return the singleton UrlValidationErrorType instances from Uri\WhatWg\Url
@@ -70,6 +83,8 @@ PHP NEWS
7083
(DanielEScherzer)
7184
. Do not use RTLD_DEEPBIND if dlmopen is available. (Daniil Gentili)
7285
. Make `clone()` a function. (timwolla, edorian)
86+
. Fixed bug GH-19081 (Wrong lineno in property error with constructor property
87+
promotion). (ilutov)
7388

7489
- Curl:
7590
. Added curl_multi_get_handles(). (timwolla)
@@ -142,6 +157,11 @@ PHP NEWS
142157
. Log a warning when opcache lock file permissions could not be changed.
143158
(Taavi Eomäe)
144159

160+
- OpenSSL:
161+
. Added openssl.libctx INI that allows to select the OpenSSL library context
162+
type and convert verious parts of the extension to use the custom libctx.
163+
(Jakub Zelenka)
164+
145165
- Output:
146166
. Fixed calculation of aligned buffer size. (cmb)
147167

UPGRADING

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ PHP 8.5 UPGRADE NOTES
4545
change, but should more closely match user expectations, demonstrated by
4646
GH-15753 and GH-16198.
4747

48+
- DOM:
49+
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
50+
Dom\HTMLCollection, and Dom\DtdNamedNodeMap now fails.
51+
This never actually resulted in a working object,
52+
so the impact should actually be zero.
53+
4854
- FileInfo:
4955
. finfo_file() and finfo::file() now throws a ValueError instead of a
5056
TypeError when $filename contains nul bytes.
@@ -551,6 +557,11 @@ PHP 8.5 UPGRADE NOTES
551557
from being a multiple of loop iteration counts.
552558
It is recommended that this parameter is set to a prime number.
553559

560+
- OpenSSL:
561+
Added openssl.libctx to select the OpenSSL library context type. Either
562+
custom libctx for each thread can be used or a single global (default)
563+
libctx is used.
564+
554565
========================================
555566
12. Windows Support
556567
========================================
@@ -599,6 +610,13 @@ PHP 8.5 UPGRADE NOTES
599610
. The `-z` or `--zend-extension` option has been removed as it was
600611
non-functional. Use `-d zend_extension=<path>` instead.
601612

613+
- PDO_ODBC
614+
. The fetch behaviour for larger columns has been changed. Rather than
615+
fetching 256 byte blocks, PDO_ODBC will try to fetch a larger block size;
616+
currently, this is the page size minus string overhead. Drivers that
617+
return SQL_NO_TOTAL in SQLGetData are also better handled as well.
618+
This should improve compatibility and performance. See GH-10809, GH-10733.
619+
602620
========================================
603621
14. Performance Improvements
604622
========================================

UPGRADING.INTERNALS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ PHP 8.5 INTERNALS UPGRADE NOTES
7676
. Preprocessor macro SIZEOF_INTMAX_T has been removed.
7777

7878
- Windows build system changes
79-
. SAPI() and ADD_SOURCES() now suport the optional `duplicate_sources`
79+
. SAPI() and ADD_SOURCES() now support the optional `duplicate_sources`
8080
parameter. If truthy, no rules to build the object files are generated.
8181
This allows to build additional variants of SAPIs (e.g. a DLL and EXE)
8282
without duplicate build rules. It is up to the SAPI maintainers to ensure

Zend/Optimizer/zend_func_infos.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ static const func_info_t func_infos[] = {
131131
F1("imagecreatefromgd", MAY_BE_OBJECT|MAY_BE_FALSE),
132132
F1("imagecreatefromgd2", MAY_BE_OBJECT|MAY_BE_FALSE),
133133
F1("imagecreatefromgd2part", MAY_BE_OBJECT|MAY_BE_FALSE),
134-
#if defined(HAVE_GD_BMP)
135134
F1("imagecreatefrombmp", MAY_BE_OBJECT|MAY_BE_FALSE),
136-
#endif
137135
F1("imagecolorsforindex", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG),
138136
F1("imagegetclip", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_LONG),
139137
#if defined(HAVE_GD_FREETYPE)

Zend/tests/ctor_promotion/ctor_promotion_callable_type.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Type of promoted property may not be callable
44
<?php
55

66
class Test {
7-
public function __construct(public callable $callable) {}
7+
public function __construct(
8+
public callable $callable
9+
) {}
810
}
911

1012
?>
1113
--EXPECTF--
12-
Fatal error: Property Test::$callable cannot have type callable in %s on line %d
14+
Fatal error: Property Test::$callable cannot have type callable in %s on line 5

Zend/tests/pipe_operator/gh18965.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
GH-18965: ASSERT_CHECK avoids pipe lhs free
3+
--INI--
4+
zend.assertions=0
5+
--FILE--
6+
<?php
7+
namespace Foo;
8+
range(0, 10) |> assert(...);
9+
echo "No leak\n";
10+
?>
11+
--EXPECT--
12+
No leak
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
OSS-Fuzz #427814452
3+
--FILE--
4+
<?php
5+
6+
try {
7+
false |> assert(...);
8+
} catch (\AssertionError $e) {
9+
echo $e::class, ": '", $e->getMessage(), "'\n";
10+
}
11+
try {
12+
0 |> "assert"(...);
13+
} catch (\AssertionError $e) {
14+
echo $e::class, ": '", $e->getMessage(), "'\n";
15+
}
16+
try {
17+
false |> ("a"."ssert")(...);
18+
} catch (\AssertionError $e) {
19+
echo $e::class, ": '", $e->getMessage(), "'\n";
20+
}
21+
22+
?>
23+
--EXPECT--
24+
AssertionError: ''
25+
AssertionError: ''
26+
AssertionError: ''

Zend/zend_API.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,8 @@ ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name,
696696
# define empty_fcall_info (zend_fcall_info) {0}
697697
# define empty_fcall_info_cache (zend_fcall_info_cache) {0}
698698
#else
699-
# define empty_fcall_info zend_fcall_info {0}
700-
# define empty_fcall_info_cache zend_fcall_info_cache {0}
699+
# define empty_fcall_info zend_fcall_info {}
700+
# define empty_fcall_info_cache zend_fcall_info_cache {}
701701
#endif
702702

703703
/** Build zend_call_info/cache from a zval*

Zend/zend_compile.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6426,6 +6426,20 @@ static bool can_match_use_jumptable(zend_ast_list *arms) {
64266426
return 1;
64276427
}
64286428

6429+
static bool zend_is_pipe_optimizable_callable_name(zend_ast *ast)
6430+
{
6431+
if (ast->kind == ZEND_AST_ZVAL && Z_TYPE_P(zend_ast_get_zval(ast)) == IS_STRING) {
6432+
/* Assert compilation adds a message operand, but this is incompatible with the
6433+
* pipe optimization that uses a temporary znode for the reference elimination.
6434+
* Therefore, disable the optimization for assert.
6435+
* Note that "assert" as a name is always treated as fully qualified. */
6436+
zend_string *str = zend_ast_get_str(ast);
6437+
return !zend_string_equals_literal_ci(str, "assert");
6438+
}
6439+
6440+
return true;
6441+
}
6442+
64296443
static void zend_compile_pipe(znode *result, zend_ast *ast)
64306444
{
64316445
zend_ast *operand_ast = ast->child[0];
@@ -6453,7 +6467,8 @@ static void zend_compile_pipe(znode *result, zend_ast *ast)
64536467

64546468
/* Turn $foo |> bar(...) into bar($foo). */
64556469
if (callable_ast->kind == ZEND_AST_CALL
6456-
&& callable_ast->child[1]->kind == ZEND_AST_CALLABLE_CONVERT) {
6470+
&& callable_ast->child[1]->kind == ZEND_AST_CALLABLE_CONVERT
6471+
&& zend_is_pipe_optimizable_callable_name(callable_ast->child[0])) {
64576472
fcall_ast = zend_ast_create(ZEND_AST_CALL,
64586473
callable_ast->child[0], arg_list_ast);
64596474
/* Turn $foo |> bar::baz(...) into bar::baz($foo). */
@@ -7683,6 +7698,8 @@ static void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast, uint32
76837698
uint32_t property_flags = param_ast->attr & (ZEND_ACC_PPP_MASK | ZEND_ACC_PPP_SET_MASK | ZEND_ACC_READONLY | ZEND_ACC_FINAL);
76847699
bool is_promoted = property_flags || hooks_ast;
76857700

7701+
CG(zend_lineno) = param_ast->lineno;
7702+
76867703
znode var_node, default_node;
76877704
uint8_t opcode;
76887705
zend_op *opline;

0 commit comments

Comments
 (0)