Skip to content

Commit 2375e07

Browse files
committed
Merge branch 'true-async-api' into true-async-api-stable
2 parents f35f445 + 852e811 commit 2375e07

File tree

20 files changed

+249
-251
lines changed

20 files changed

+249
-251
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PHP NEWS
44

55
- Core:
66
. Add clone-with support to the clone() function. (timwolla, edorian)
7+
. Fix support for non-userland stream notifiers. (timwolla)
78

89
- Curl:
910
. Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan)
@@ -18,6 +19,7 @@ PHP NEWS
1819
. Error handling of Uri\WhatWg\Url::withHost() is fixed when the input
1920
contains a port. Now, it triggers an exception; previously, the error
2021
was silently swallowed. (Máté Kocsis)
22+
. Support empty URIs with Uri\Rfc3986\Uri. (timwolla)
2123

2224
17 Jul 2025, PHP 8.5.0alpha2
2325

UPGRADING.INTERNALS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ PHP 8.5 INTERNALS UPGRADE NOTES
2323
the user side when requiring libphp.so, by using dlmopen with LM_ID_NEWLM
2424
instead of dlopen.
2525
RTLD_DEEPBIND is still enabled when the Apache SAPI is in use.
26+
. The ptr field of the php_stream_notifier struct is now a void* instead
27+
of a zval. If the zval was used to store IS_PTR values only, the
28+
extra layer of indirection can be removed. In other cases a zval can
29+
be heap-allocated and stored in the pointer as a minimal change to keep
30+
compatibility.
2631

2732
- Zend
2833
. Added zend_safe_assign_to_variable_noref() function to safely assign

Zend/zend_API.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5000,7 +5000,7 @@ ZEND_API void zend_declare_class_constant_string(zend_class_entry *ce, const cha
50005000
}
50015001
/* }}} */
50025002

5003-
ZEND_API void zend_update_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zval *value) /* {{{ */
5003+
ZEND_API void zend_update_property_ex(const zend_class_entry *scope, zend_object *object, zend_string *name, zval *value) /* {{{ */
50045004
{
50055005
const zend_class_entry *old_scope = EG(fake_scope);
50065006

@@ -5012,7 +5012,7 @@ ZEND_API void zend_update_property_ex(zend_class_entry *scope, zend_object *obje
50125012
}
50135013
/* }}} */
50145014

5015-
ZEND_API void zend_update_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value) /* {{{ */
5015+
ZEND_API void zend_update_property(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value) /* {{{ */
50165016
{
50175017
zend_string *property;
50185018
const zend_class_entry *old_scope = EG(fake_scope);
@@ -5027,7 +5027,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zend_object *object,
50275027
}
50285028
/* }}} */
50295029

5030-
ZEND_API void zend_update_property_null(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length) /* {{{ */
5030+
ZEND_API void zend_update_property_null(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length) /* {{{ */
50315031
{
50325032
zval tmp;
50335033

@@ -5036,7 +5036,7 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zend_object *ob
50365036
}
50375037
/* }}} */
50385038

5039-
ZEND_API void zend_unset_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length) /* {{{ */
5039+
ZEND_API void zend_unset_property(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length) /* {{{ */
50405040
{
50415041
zend_string *property;
50425042
const zend_class_entry *old_scope = EG(fake_scope);
@@ -5051,7 +5051,7 @@ ZEND_API void zend_unset_property(zend_class_entry *scope, zend_object *object,
50515051
}
50525052
/* }}} */
50535053

5054-
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value) /* {{{ */
5054+
ZEND_API void zend_update_property_bool(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value) /* {{{ */
50555055
{
50565056
zval tmp;
50575057

@@ -5060,7 +5060,7 @@ ZEND_API void zend_update_property_bool(zend_class_entry *scope, zend_object *ob
50605060
}
50615061
/* }}} */
50625062

5063-
ZEND_API void zend_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value) /* {{{ */
5063+
ZEND_API void zend_update_property_long(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value) /* {{{ */
50645064
{
50655065
zval tmp;
50665066

@@ -5069,7 +5069,7 @@ ZEND_API void zend_update_property_long(zend_class_entry *scope, zend_object *ob
50695069
}
50705070
/* }}} */
50715071

5072-
ZEND_API void zend_update_property_double(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, double value) /* {{{ */
5072+
ZEND_API void zend_update_property_double(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, double value) /* {{{ */
50735073
{
50745074
zval tmp;
50755075

@@ -5078,7 +5078,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zend_object *
50785078
}
50795079
/* }}} */
50805080

5081-
ZEND_API void zend_update_property_str(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_string *value) /* {{{ */
5081+
ZEND_API void zend_update_property_str(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_string *value) /* {{{ */
50825082
{
50835083
zval tmp;
50845084

@@ -5087,7 +5087,7 @@ ZEND_API void zend_update_property_str(zend_class_entry *scope, zend_object *obj
50875087
}
50885088
/* }}} */
50895089

5090-
ZEND_API void zend_update_property_string(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value) /* {{{ */
5090+
ZEND_API void zend_update_property_string(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value) /* {{{ */
50915091
{
50925092
zval tmp;
50935093

@@ -5097,7 +5097,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zend_object *
50975097
}
50985098
/* }}} */
50995099

5100-
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value, size_t value_len) /* {{{ */
5100+
ZEND_API void zend_update_property_stringl(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value, size_t value_len) /* {{{ */
51015101
{
51025102
zval tmp;
51035103

Zend/zend_API.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -494,16 +494,16 @@ static zend_always_inline HashTable *zend_class_backed_enum_table(zend_class_ent
494494
}
495495
}
496496

497-
ZEND_API void zend_update_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zval *value);
498-
ZEND_API void zend_update_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value);
499-
ZEND_API void zend_update_property_null(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length);
500-
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
501-
ZEND_API void zend_update_property_long(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
502-
ZEND_API void zend_update_property_double(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, double value);
503-
ZEND_API void zend_update_property_str(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_string *value);
504-
ZEND_API void zend_update_property_string(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value);
505-
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value, size_t value_length);
506-
ZEND_API void zend_unset_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length);
497+
ZEND_API void zend_update_property_ex(const zend_class_entry *scope, zend_object *object, zend_string *name, zval *value);
498+
ZEND_API void zend_update_property(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value);
499+
ZEND_API void zend_update_property_null(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length);
500+
ZEND_API void zend_update_property_bool(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
501+
ZEND_API void zend_update_property_long(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_long value);
502+
ZEND_API void zend_update_property_double(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, double value);
503+
ZEND_API void zend_update_property_str(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_string *value);
504+
ZEND_API void zend_update_property_string(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value);
505+
ZEND_API void zend_update_property_stringl(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, const char *value, size_t value_length);
506+
ZEND_API void zend_unset_property(const zend_class_entry *scope, zend_object *object, const char *name, size_t name_length);
507507

508508
ZEND_API zend_result zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value);
509509
ZEND_API zend_result zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);

Zend/zend_portability.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,9 @@ extern "C++" {
799799
/** @deprecated */
800800
#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END
801801

802-
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
802+
#if defined(__cplusplus)
803+
# define ZEND_STATIC_ASSERT(c, m) static_assert((c), m)
804+
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
803805
# define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)
804806
#else
805807
# define ZEND_STATIC_ASSERT(c, m)

docs/release-process.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,16 @@ slightly different steps. We'll call attention where the steps differ.
500500
> report any potential bugs that should be fixed before the upcoming GA
501501
> release.
502502
503-
5. 🔶 **For pre-GA *RCs* only,** coordinate with the social media team (i.e.,
504-
Derick) to post a tweet with the RC release announcement and link to the news
505-
entry on php.net. ([@official_php](https://twitter.com/official_php))
503+
5. 🔶 **For alphas, betas, and *pre-GA* RCs,** coordinate with the
504+
social media team (i.e., Derick and Sergey) to post a toot containing the
505+
release announcement and link to the news entry on php.net.
506+
You can send a PR to [toot-together](https://github.com/derickr/toot-together/)
507+
with highlights from the NEWS file yourself, if you want.
508+
509+
* [Annonce 8.5.0alpha1](https://github.com/derickr/toot-together/pull/42)
510+
* [Annonce 8.5.0alpha2](https://github.com/derickr/toot-together/pull/47)
511+
512+
We post to [@php@fosstodon.org](https://fosstodon.org/@php).
506513
507514
508515
## Packaging a stable release

ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,16 @@ static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
3232
return (RuleBasedBreakIterator*)bio->biter;
3333
}
3434

35-
static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS, zend_error_handling *error_handling, bool *error_handling_replaced)
35+
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
3636
{
37-
char *rules;
38-
size_t rules_len;
39-
bool compiled = false;
40-
UErrorCode status = U_ZERO_ERROR;
37+
zend_string *rules;
38+
bool compiled = false;
39+
UErrorCode status = U_ZERO_ERROR;
4140
BREAKITER_METHOD_INIT_VARS;
4241
object = ZEND_THIS;
4342

4443
ZEND_PARSE_PARAMETERS_START(1, 2)
45-
Z_PARAM_STRING(rules, rules_len)
44+
Z_PARAM_STR(rules)
4645
Z_PARAM_OPTIONAL
4746
Z_PARAM_BOOL(compiled)
4847
ZEND_PARSE_PARAMETERS_END();
@@ -53,20 +52,14 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS, zend_er
5352
RETURN_THROWS();
5453
}
5554

56-
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, error_handling);
57-
*error_handling_replaced = 1;
58-
59-
// instantiation of ICU object
6055
RuleBasedBreakIterator *rbbi;
6156

6257
if (!compiled) {
6358
UnicodeString rulesStr;
6459
UParseError parseError = UParseError();
65-
if (intl_stringFromChar(rulesStr, rules, rules_len, &status)
66-
== FAILURE) {
60+
if (intl_stringFromChar(rulesStr, ZSTR_VAL(rules), ZSTR_LEN(rules), &status) == FAILURE) {
6761
zend_throw_exception(IntlException_ce_ptr,
68-
"IntlRuleBasedBreakIterator::__construct(): "
69-
"rules were not a valid UTF-8 string", 0);
62+
"IntlRuleBasedBreakIterator::__construct(): rules were not a valid UTF-8 string", 0);
7063
RETURN_THROWS();
7164
}
7265

@@ -84,29 +77,16 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS, zend_er
8477
RETURN_THROWS();
8578
}
8679
} else { // compiled
87-
rbbi = new RuleBasedBreakIterator((uint8_t*)rules, rules_len, status);
80+
rbbi = new RuleBasedBreakIterator(reinterpret_cast<uint8_t *>(ZSTR_VAL(rules)), ZSTR_LEN(rules), status);
8881
if (U_FAILURE(status)) {
8982
zend_throw_exception(IntlException_ce_ptr,
90-
"IntlRuleBasedBreakIterator::__construct(): "
91-
"unable to create instance from compiled rules", 0);
83+
"IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules", 0);
9284
delete rbbi;
9385
RETURN_THROWS();
9486
}
9587
}
9688

97-
breakiterator_object_create(return_value, rbbi, 0);
98-
}
99-
100-
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
101-
{
102-
zend_error_handling error_handling;
103-
bool error_handling_replaced = 0;
104-
105-
return_value = ZEND_THIS;
106-
_php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU, &error_handling, &error_handling_replaced);
107-
if (error_handling_replaced) {
108-
zend_restore_error_handling(&error_handling);
109-
}
89+
breakiterator_object_create(object, rbbi, false);
11090
}
11191

11292
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, getRules)

ext/intl/dateformat/dateformat_format_object.cpp

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
7070
size_t locale_len;
7171
bool pattern = false;
7272
UDate date;
73-
TimeZone *timeZone = NULL;
73+
std::unique_ptr<TimeZone> timeZone;
7474
UErrorCode status = U_ZERO_ERROR;
75-
DateFormat *df = NULL;
76-
Calendar *cal = NULL;
75+
std::unique_ptr<DateFormat> df;
76+
std::unique_ptr<Calendar> cal;
7777
DateFormat::EStyle dateStyle = DateFormat::kDefault,
7878
timeStyle = DateFormat::kDefault;
7979

@@ -158,28 +158,28 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
158158
"not initialized properly", 0);
159159
RETURN_FALSE;
160160
}
161-
timeZone = obj_cal->getTimeZone().clone();
161+
timeZone = std::unique_ptr<TimeZone>(obj_cal->getTimeZone().clone());
162162
date = obj_cal->getTime(status);
163163
if (U_FAILURE(status)) {
164164
intl_error_set(NULL, status,
165165
"datefmt_format_object: error obtaining instant from "
166166
"IntlCalendar", 0);
167-
RETVAL_FALSE;
168-
goto cleanup;
167+
RETURN_FALSE;
169168
}
170-
cal = obj_cal->clone();
169+
cal = std::unique_ptr<Calendar>(obj_cal->clone());
171170
} else if (instanceof_function(instance_ce, php_date_get_interface_ce())) {
172-
if (intl_datetime_decompose(object, &date, &timeZone, NULL,
171+
TimeZone *tz;
172+
if (intl_datetime_decompose(object, &date, &tz, NULL,
173173
"datefmt_format_object") == FAILURE) {
174174
RETURN_FALSE;
175175
}
176-
cal = new GregorianCalendar(Locale::createFromName(locale_str), status);
176+
timeZone = std::unique_ptr<TimeZone>(tz);
177+
cal = std::unique_ptr<Calendar>(new GregorianCalendar(Locale::createFromName(locale_str), status));
177178
if (U_FAILURE(status)) {
178179
intl_error_set(NULL, status,
179180
"datefmt_format_object: could not create GregorianCalendar",
180181
0);
181-
RETVAL_FALSE;
182-
goto cleanup;
182+
RETURN_FALSE;
183183
}
184184
} else {
185185
intl_error_set(NULL, status, "datefmt_format_object: the passed object "
@@ -190,36 +190,32 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
190190

191191
if (pattern) {
192192
StringPiece sp(Z_STRVAL_P(format));
193-
df = new SimpleDateFormat(
193+
df = std::unique_ptr<DateFormat>(new SimpleDateFormat(
194194
UnicodeString::fromUTF8(sp),
195195
Locale::createFromName(locale_str),
196-
status);
196+
status));
197197

198198
if (U_FAILURE(status)) {
199199
intl_error_set(NULL, status,
200200
"datefmt_format_object: could not create SimpleDateFormat",
201201
0);
202-
RETVAL_FALSE;
203-
goto cleanup;
202+
RETURN_FALSE;
204203
}
205204
} else {
206-
df = DateFormat::createDateTimeInstance(dateStyle, timeStyle,
207-
Locale::createFromName(locale_str));
205+
df = std::unique_ptr<DateFormat>(DateFormat::createDateTimeInstance(dateStyle, timeStyle,
206+
Locale::createFromName(locale_str)));
208207

209208
if (df == NULL) { /* according to ICU sources, this should never happen */
210209
intl_error_set(NULL, status,
211210
"datefmt_format_object: could not create DateFormat",
212211
0);
213-
RETVAL_FALSE;
214-
goto cleanup;
212+
RETURN_FALSE;
215213
}
216214
}
217215

218216
//must be in this order (or have the cal adopt the tz)
219-
df->adoptCalendar(cal);
220-
cal = NULL;
221-
df->adoptTimeZone(timeZone);
222-
timeZone = NULL;
217+
df->adoptCalendar(cal.release());
218+
df->adoptTimeZone(timeZone.release());
223219

224220
{
225221
zend_string *u8str;
@@ -231,15 +227,8 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
231227
intl_error_set(NULL, status,
232228
"datefmt_format_object: error converting result to UTF-8",
233229
0);
234-
RETVAL_FALSE;
235-
goto cleanup;
230+
RETURN_FALSE;
236231
}
237232
RETVAL_STR(u8str);
238233
}
239-
240-
241-
cleanup:
242-
delete df;
243-
delete timeZone;
244-
delete cal;
245234
}

ext/snmp/snmp.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,21 +1038,18 @@ static bool snmp_session_set_auth_protocol(struct snmp_session *s, zend_string *
10381038
}
10391039
#endif
10401040

1041-
smart_string err = {0};
1042-
1043-
smart_string_appends(&err, "Authentication protocol must be \"SHA\"");
1041+
zend_value_error(
1042+
"Authentication protocol must be \"SHA\""
10441043
#ifdef HAVE_SNMP_SHA256
1045-
smart_string_appends(&err, " or \"SHA256\"");
1044+
" or \"SHA256\""
10461045
#endif
10471046
#ifdef HAVE_SNMP_SHA512
1048-
smart_string_appends(&err, " or \"SHA512\"");
1047+
" or \"SHA512\""
10491048
#endif
10501049
#ifndef DISABLE_MD5
1051-
smart_string_appends(&err, " or \"MD5\"");
1050+
" or \"MD5\""
10521051
#endif
1053-
smart_string_0(&err);
1054-
zend_value_error("%s", err.c);
1055-
smart_string_free(&err);
1052+
);
10561053
return false;
10571054
}
10581055
/* }}} */

0 commit comments

Comments
 (0)