Skip to content

build/gen_stub: include attribute arguments in synopsis modifiers#22417

Closed
jordikroon wants to merge 5394 commits into
php:PHP-8.4from
jordikroon:gen-stub-attribute-args
Closed

build/gen_stub: include attribute arguments in synopsis modifiers#22417
jordikroon wants to merge 5394 commits into
php:PHP-8.4from
jordikroon:gen-stub-attribute-args

Conversation

@jordikroon

@jordikroon jordikroon commented Jun 23, 2026

Copy link
Copy Markdown
Member

Output: php/doc-en#5631

devnexen and others added 30 commits May 24, 2026 21:34
* PHP-8.5:
  Fix phpGH-19739: imageellipse/imagefilledellipse overflow.
It's needed to implement php#22075 for https://wiki.php.net/rfc/uri_followup#uri_type_detection.

Since the upstream changes to lexbor (lexbor/lexbor#362) haven't been released yet, a patch is added for now.
Closes phpGH-22133.

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
Add stream context options psk_client_cb and psk_server_cb that
let clients and servers negotiate pre-shared key authentication
on both TLS 1.2 and TLS 1.3. Callbacks return an Openssl\Psk
instance carrying the key and, on clients, the identity, or
null to refuse PSK.

A new final Openssl\Psk class is added for that purpose, with
readonly $psk and $identity properties and MAX_PSK_LEN /
MAX_IDENTITY_LEN constants.

Closes phpGH-22057
* PHP-8.4:
  [skip ci] Remove PECL build
* PHP-8.5:
  [skip ci] Remove PECL build
As we list all other commands to run, this was added for consistency

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
* PHP-8.4:
  dom: Update contributor name in CREDITS
* PHP-8.5:
  dom: Update contributor name in CREDITS
  uri: Update contributor name in CREDITS
- The "pclmul" and "cldemote" CPU features are both only available on x86, and the relevant __builtin_cpu_supports() checks fail on Clang, so they shouldn't even be attempted to be run (similar fixes before: php#18629).
- The res.h file in Lexbor contains some unterminated strings (e.g. https://github.com/php/php-src/blob/d58d3d2fd6c1cfa7e3489a9859eda63086af762f/ext/lexbor/lexbor/html/tokenizer/res.h#L203), and a new compiler warning fails by default because of them. This needs to be suppressed.
* PHP-8.4:
  Fix phpGH-22138: skip libxml/xmlreader tests on non-ASCII paths.
* PHP-8.5:
  Fix phpGH-22138: skip libxml/xmlreader tests on non-ASCII paths.
…#22165)

ext/uri is always built statically (false /* never shared */ in
EXTENSION()) and includes the bundled lexbor headers via /I ext/lexbor.
On Windows, lexbor's LXB_API macro defaults to __declspec(dllimport),
which produces LNK2019 unresolved external symbol errors for every
lxb_* function referenced from ext/uri when PHP itself is linked
statically without a runtime DLL.

Adding /D LEXBOR_STATIC to CFLAGS_URI in ext/uri/config.w32 makes
LXB_API expand to nothing for ext/uri's compilation units. The scope
matches URI_STATIC_BUILD on the same line: per-consumer, because
other lexbor consumers (e.g. ext/dom, which can build as shared)
must decide for themselves whether to disable the dllimport
decoration.
* PHP-8.5:
  Define LEXBOR_STATIC in CFLAGS_URI for static ext/uri on Windows (php#22165)
…erialization (php#22090)

This aligns the behaviour with the constructor of ArrayObject.
Use size_t in phar_hex_str to avoid signed integer overflow when
hex-encoding an attacker-controlled signature length, and fail
verification in phar_call_openssl_verify when the stream read is
short rather than proceeding over a truncated buffer.
…nt-encoded userinfo.

php_url_decode() returns the shorter decoded length but ZSTR_LEN() is left
untouched, so smart_str_append() carries the stale [decoded][NUL][undecoded
tail] bytes into the base64 credentials.

Fix php#22171

close phpGH-22172
…nt-encoded userinfo.

php_url_decode() returns the shorter decoded length but ZSTR_LEN() is left
untouched, so smart_str_append() carries the stale [decoded][NUL][undecoded
tail] bytes into the base64 credentials.

Fix php#22171

close phpGH-22172
* PHP-8.5:
  ext/standard: http(s) wrapper corrupts the basic auth header on percent-encoded userinfo.
This introduces new stream error handling that allows configurable
handling of stream errors. This can be configured in stream contex.

All streams, ext/standard and ext/phar stream errors are converted to
use the new API.

RFC: https://wiki.php.net/rfc/stream_errors

Closes phpGH-20524
This was leaking because php_openssl_enable_crypto can be called
multiple times. The reneg was moved there after the session changes so
it needs to only happen once there.

The fix moves it (and some other parts that should be done just once)
inside state_set block where it can run only once.
* PHP-8.4:
  Fix phpGH-19730: undefined behavior in gd_interpolation.c.
LamentXU123 and others added 16 commits June 22, 2026 14:18
* PHP-8.5:
  [skip ci] Fix NEWS entry for several Intl fixes into the latest version section
…nvert

pgsqlCopyFromArray() feeds each row through try_convert_to_string(). A
non-stringable row throws a TypeError, but both the array and iterator
branches then called pdo_pgsql_error() and recorded a fabricated
PGRES_FATAL_ERROR, leaving PDO::errorInfo() reporting "HY000" for what is
a client-side type error. Return through the pending exception instead of
overwriting the driver error state.

Closes phpGH-22384
* PHP-8.5:
  pdo_pgsql: preserve the pending exception when a COPY row fails to convert
IntlListFormatter stores a UListFormatter pointer. Calling the constructor
again on an already initialized object overwrote the existing pointer and
leaked the previous formatter.

Follow up to the double construction fixes from phpGH-22386 by rejecting repeated
IntlListFormatter::__construct() calls.

Closes php#22394
* PHP-8.5:
  ext/Intl: Fix IntlListFormatter double construction leak (php#22394)
…p#22273)

When handling sequences like this in a stub:

```php
<?php
class Whatever {
    public static string $foobar1 = "CCC \n\r\t\v\e\f\\\$\"\101\x41\u{41} CCC";
    public static string $foobar2 = 'CCC \n\r\t\v\e\f\\\$\"\101\x41\u{41} CCC';
}
```

...properly generate C headers that properly escape the string.
Otherwise, the differing escaping rules and differences between PHP's
single and double quoted strings could lead to mangled headers.

The output of these strings after the stub has been generated:

```
string(22) "BEGIN

	��\$"AAA END"
string(43) "BEGIN \n\r\t\v\e\f\\\\$\"\101\x41\u{41} END"
```

And the generated arginfo:

```c
        zval property_doubleQuoteEscaped_default_value;
        zend_string *property_doubleQuoteEscaped_default_value_str = zend_string_init("BEGIN \n\r\t\v\x1b\f\\$\"AAA END", strlen("BEGIN \n\r\t\v\x1b\f\\$\"AAA END"), 1);
pp      ZVAL_STR(&property_doubleQuoteEscaped_default_value, property_doubleQuoteEscaped_default_value_str);
        zend_string *property_doubleQuoteEscaped_name = zend_string_init("doubleQuoteEscaped", sizeof("doubleQuoteEscaped") - 1, true);
        zend_declare_typed_property(class_entry, property_doubleQuoteEscaped_name, &property_doubleQuoteEscaped_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
        zend_string_release_ex(property_doubleQuoteEscaped_name, true);

        zval property_singleQuoteEscaped_default_value;
        zend_string *property_singleQuoteEscaped_default_value_str = zend_string_init("BEGIN \\n\\r\\t\\v\\e\\f\\\\\\\\$\\\"\\101\\x41\\u{41} END", strlen("BEGIN \\n\\r\\t\\v\\e\\f\\\\\\\\$\\\"\\101\\x41\\u{41} END"), 1);
        ZVAL_STR(&property_singleQuoteEscaped_default_value, property_singleQuoteEscaped_default_value_str);
        zend_string *property_singleQuoteEscaped_name = zend_string_init("singleQuoteEscaped", sizeof("singleQuoteEscaped") - 1, true);
        zend_declare_typed_property(class_entry, property_singleQuoteEscaped_name, &property_singleQuoteEscaped_default_value, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
        zend_string_release_ex(property_singleQuoteEscaped_name, true);
```

Note that the PHP escape sequence "\$" will be handled in a special
manner to avoid providing it to C, to avoid C compiler warnings.

Tests are included via the zend_test stub and a phpt file to ensure that
the escape sequences match.

Fixes phpGH-22169.
* PHP-8.4:
  ext/sockets/tests/gh21161.phpt: skip if no ipv6 (php#22403)
* PHP-8.5:
  ext/sockets/tests/gh21161.phpt: skip if no ipv6 (php#22403)
* PHP-8.4:
  Fix session save-handler argv leak on recursive rejection
* PHP-8.5:
  Fix session save-handler argv leak on recursive rejection
* PHP-8.4:
  Fix phpGH-22395: Avoid truncating base_convert() output at 64 characters (php#22406)
* PHP-8.5:
  Fix phpGH-22395: Avoid truncating base_convert() output at 64 characters (php#22406)
* PHP-8.4:
  ext/phar: Fix .phar-prefixed non-magic directory handling (php#22372)
* PHP-8.5:
  ext/phar: Fix .phar-prefixed non-magic directory handling (php#22372)
@jordikroon jordikroon force-pushed the gen-stub-attribute-args branch from 38fe46c to 89341da Compare June 23, 2026 19:57
@jordikroon jordikroon changed the base branch from master to PHP-8.4 June 23, 2026 20:14
@jordikroon jordikroon closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.