Skip to content

Commit 7b17e1e

Browse files
Merge branch 'php:master' into zend-stub-types
2 parents e4b793c + d2635b1 commit 7b17e1e

File tree

462 files changed

+18981
-5503
lines changed

Some content is hidden

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

462 files changed

+18981
-5503
lines changed

CODEOWNERS renamed to .github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,24 @@
1616
/ext/dba @Girgias
1717
/ext/dom @nielsdos
1818
/ext/ffi @dstogov
19+
/ext/gettext @devnexen
1920
/ext/gmp @Girgias
2021
/ext/intl @devnexen
2122
/ext/json @bukka
2223
/ext/libxml @nielsdos
2324
/ext/mbstring @alexdowad
25+
/ext/odbc @NattyNarwhal
2426
/ext/opcache @dstogov @iluuu1994
2527
/ext/openssl @bukka
26-
/ext/odbc @NattyNarwhal
28+
/ext/pdo_odbc @NattyNarwhal
2729
/ext/pdo_pgsql @devnexen
2830
/ext/pgsql @devnexen
2931
/ext/random @TimWolla @zeriyoshi
3032
/ext/session @Girgias
3133
/ext/sockets @devnexen
3234
/ext/spl @Girgias
3335
/ext/standard @bukka
36+
/ext/xmlreader @nielsdos
3437
/ext/xsl @nielsdos
3538
/main @bukka
3639
/sapi/fpm @bukka

.github/actions/brew/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ runs:
55
- shell: bash
66
run: |
77
set -x
8+
9+
# Patch brew to overwrite always
10+
formula_installer="$(brew --repo)"/Library/Homebrew/formula_installer.rb
11+
code=" keg.link\(verbose: verbose\?"
12+
sudo sed -Ei '' "s/$code.*/$code, overwrite: true\)/" "$formula_installer"
13+
814
brew install \
915
pkg-config \
1016
autoconf \

.github/actions/setup-caddy/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ runs:
1010
gh release -R caddyserver/caddy download --pattern 'caddy_*_linux_amd64.tar.gz' -O - | sudo tar -xz -C /usr/bin caddy
1111
sudo chmod +x /usr/bin/caddy
1212
sudo caddy start --config ext/curl/tests/Caddyfile
13+
continue-on-error: true

.github/actions/test-libmysqlclient/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ runs:
1414
export PDO_MYSQL_TEST_HOST=127.0.0.1
1515
export PDO_MYSQL_TEST_USER=root
1616
export PDO_MYSQL_TEST_PASS=root
17-
export REPORT_EXIT_STATUS=no
1817
sapi/cli/php run-tests.php -P -q \
1918
-g FAIL,BORK,LEAK,XLEAK \
2019
--no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 \

NEWS

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ PHP NEWS
1313
array to hashed). (ilutov)
1414
. Fixed zend fiber build for solaris default mode (32 bits). (David Carlier)
1515
. Fixed zend call stack size for macOs/arm64. (David Carlier)
16-
. Added support for Zend Max Execution Timers on FreeBSD (Kévin Dunglas)
16+
. Added support for Zend Max Execution Timers on FreeBSD. (Kévin Dunglas)
17+
. Ensure fiber stack is not backed by THP. (crrodriguez)
18+
. Implement GH-13609 (Dump wrapped object in WeakReference class). (nielsdos)
1719

1820
- Curl:
1921
. Deprecated the CURLOPT_BINARYTRANSFER constant. (divinity76)
@@ -22,7 +24,7 @@ PHP NEWS
2224

2325
- Date:
2426
. Added DateTime[Immutable]::createFromTimestamp. (Marc Bennewitz)
25-
. Added DateTime[Immutable]::[get|set]Microseconds. (Marc Bennewitz)
27+
. Added DateTime[Immutable]::[get|set]Microsecond. (Marc Bennewitz)
2628

2729
- DOM:
2830
. Added DOMNode::compareDocumentPosition(). (nielsdos)
@@ -34,6 +36,7 @@ PHP NEWS
3436
. Handle OOM more consistently. (nielsdos)
3537
. Implemented "Improve callbacks in ext/dom and ext/xsl" RFC. (nielsdos)
3638
. Added DOMXPath::quote() static method. (divinity76)
39+
. Implemented opt-in ext/dom spec compliance RFC. (nielsdos)
3740

3841
- Fileinfo:
3942
. Update to libmagic 5.45. (nielsdos)
@@ -47,6 +50,13 @@ PHP NEWS
4750
- FTP:
4851
. Removed the deprecated inet_ntoa call support. (David Carlier)
4952

53+
- Gettext:
54+
. bind_textdomain_codeset now throws an exception on empty domain.
55+
(David Carlier)
56+
57+
- Hash:
58+
. Changed return type of hash_update() to true. (nielsdos)
59+
5060
- IMAP:
5161
. Moved to PECL. (Derick Rethans)
5262

@@ -80,6 +90,9 @@ PHP NEWS
8090
- MBString:
8191
. Added mb_trim, mb_ltrim and mb_rtrim. (Yuya Hamada)
8292

93+
- MySQLnd:
94+
. Fixed bug GH-13440 (PDO quote bottleneck). (nielsdos)
95+
8396
- Opcache:
8497
. Added large shared segments support for FreeBSD. (David Carlier)
8598
. If JIT is enabled, PHP will now exit with a fatal error on startup in case
@@ -100,6 +113,7 @@ PHP NEWS
100113

101114
- PCRE:
102115
. Upgrade bundled pcre2lib to version 10.43. (nielsdos)
116+
. Add "/r" modifier. (Ayesh)
103117

104118
- PDO:
105119
. Fixed setAttribute and getAttribute. (SakiTakamachi)
@@ -118,9 +132,6 @@ PHP NEWS
118132
- PDO_MYSQL:
119133
. Fixed setAttribute and getAttribute. (SakiTakamachi)
120134
. Added class PdoMysql. (danack, kocsismate)
121-
. Fixed binding of Stringable objects. (SakiTakamachi)
122-
. Added an error message when a non-scalar value is bound with PARAM_INT.
123-
(SakiTakamachi)
124135

125136
- PDO_ODBC:
126137
. Added class PdoOdbc. (danack, kocsismate)
@@ -198,10 +209,16 @@ PHP NEWS
198209
. Changed return type of long2ip to string from string|false. (Jorg Sowa)
199210
. Fix GH-12143 (Extend the maximum precision round can handle by one digit).
200211
(SakiTakamachi)
212+
. Added the http_get_last_response_headers() and
213+
http_clear_last_response_headers() that allows retrieving the same content
214+
as the magic $http_response_header variable.
201215

202216
- XML:
203217
. Added XML_OPTION_PARSE_HUGE parser option. (nielsdos)
204218

219+
- XMLReader:
220+
. Declares class constant types. (Ayesh)
221+
205222
- XSL:
206223
. Implement request #64137 (XSLTProcessor::setParameter() should allow both
207224
quotes to be used). (nielsdos)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ contribute:
132132
- [Contributing to PHP](/CONTRIBUTING.md)
133133
- [PHP coding standards](/CODING_STANDARDS.md)
134134
- [Internal documentation](https://php.github.io/php-src/)
135-
- [Mailing list rules](/docs-old/mailinglist-rules.md)
136-
- [PHP release process](/docs-old/release-process.md)
135+
- [Mailing list rules](/docs/mailinglist-rules.md)
136+
- [PHP release process](/docs/release-process.md)
137137

138138
## Credits
139139

TSRM/threads.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ if test "$pthreads_working" != "yes"; then
126126
fi
127127
])
128128
129-
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
129+
if test "x$ac_cv_pthreads_cflags" != "x" || test "x$ac_cv_pthreads_lib" != "x"; then
130130
pthreads_working="yes"
131131
fi
132132
])

UPGRADING

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,20 @@ PHP 8.4 UPGRADE NOTES
164164
. Added request_parse_body() function that allows parsing RFC1867 (multipart)
165165
requests in non-POST HTTP requests.
166166
RFC: https://wiki.php.net/rfc/rfc1867-non-post
167+
. Getting the debug info for WeakReference will now also output the object
168+
it references, or null if the reference is no longer valid.
169+
170+
- Curl:
171+
. curl_version() returns an additional feature_list value, which is an
172+
associative array of all known Curl features, and whether they are
173+
supported (true) or not (false).
167174

168175
- Date:
169176
. Added static methods
170177
DateTime[Immutable]::createFromTimestamp(int|float $timestamp): static.
171-
. Added method DateTime[Immutable]::getMicroseconds(): int.
178+
. Added method DateTime[Immutable]::getMicrosecond(): int.
172179
. Added method
173-
DateTime[Immutable]::setMicroseconds(int $microseconds): static.
180+
DateTime[Immutable]::setMicrosecond(int $microsecond): static.
174181

175182
- DOM:
176183
. Added constant DOMNode::DOCUMENT_POSITION_DISCONNECTED.
@@ -179,20 +186,16 @@ PHP 8.4 UPGRADE NOTES
179186
. Added constant DOMNode::DOCUMENT_POSITION_CONTAINS.
180187
. Added constant DOMNode::DOCUMENT_POSITION_CONTAINED_BY.
181188
. Added constant DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC.
182-
. Implemented DOM HTML5 parsing and serialization.
183-
RFC: https://wiki.php.net/rfc/domdocument_html5_parser.
184-
This RFC adds the new DOM namespace along with class and constant aliases.
185-
There are two new classes to handle HTML and XML documents:
186-
DOM\HTMLDocument and DOM\XMLDocument.
187-
These classes provide a cleaner API to handle HTML and XML documents.
188-
Furthermore, the DOM\HTMLDocument class implements spec-compliant HTML5
189-
parsing and serialization.
190189
. It is now possible to pass any callable to registerPhpFunctions().
191190
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
192191

193192
- FPM:
194193
. Flushing headers without a body will now succeed. See GH-12785.
195194

195+
- Intl:
196+
. NumberFormatter::ROUND_HALFODD added to complement existing
197+
NumberFormatter::ROUND_HALFEVEN functionality.
198+
196199
- Phar:
197200
. Added support for the unix timestamp extension for zip archives.
198201

@@ -201,6 +204,10 @@ PHP 8.4 UPGRADE NOTES
201204
As a consequence, LoongArch JIT support has been added, spaces
202205
are now allowed between braces in Perl-compatible items, and
203206
variable-length lookbehind assertions are now supported.
207+
. Added support for the "r" (PCRE2_EXTRA_CASELESS_RESTRICT) modifier, as well
208+
as the (?r) mode modifier. When enabled along with the case-insensitive
209+
modifier ("i"), the expression locks out mixing of ASCII and non-ASCII
210+
characters.
204211

205212
- PDO:
206213
. Added support for driver-specific subclasses.
@@ -211,8 +218,7 @@ PHP 8.4 UPGRADE NOTES
211218
or by invoking their constructor directly.
212219

213220
- PDO_DBLIB:
214-
. Fixed setAttribute and getAttribute (SakiTakamachi)
215-
. Added PdoDbLib class (danack, kocsismate)
221+
. Added class PdoDbLib.
216222

217223
- PDO_FIREBIRD:
218224
. Added class PdoFirebird.
@@ -264,9 +270,6 @@ PHP 8.4 UPGRADE NOTES
264270

265271
- Curl:
266272
. The CURLOPT_BINARYTRANSFER constant is deprecated.
267-
. curl_version() returns an additional feature_list value, which is an
268-
associative array of all known Curl features, and whether they are
269-
supported (true) or not (false).
270273

271274
- Date:
272275
. Calling DatePeriod::__construct(string $isostr, int $options = 0) is
@@ -319,15 +322,20 @@ PHP 8.4 UPGRADE NOTES
319322
. DOMDocument::registerNodeClass() now has a tentative return type of true.
320323
Previously, the return type was bool but only true could be returned in practice.
321324

325+
- Gettext:
326+
. bind_textdomain_codeset now throws an exception if the domain's argument is empty.
327+
328+
- Hash:
329+
. Changed the return type of hash_update() to true. It was already the case that only
330+
true could be returned, but the stub was not updated yet.
331+
322332
- Intl:
323333
. IntlDateFormatter::__construct() throws a ValueError if the locale is invalid.
324334
. NumberFormatter::__construct() throws a ValueError if the locale is invalid.
325335
. NumberFormatter::ROUND_TOWARD_ZERO and NumberFormatter::ROUND_AWAY_FROM_ZERO
326336
have been added as aliases for NumberFormatter::ROUND_DOWN and
327337
NumberFormatter::ROUND_UP to be consistent with the new PHP_ROUND_* modes.
328338
RFC: https://wiki.php.net/rfc/new_rounding_modes_to_round_function
329-
. NumberFormatter::ROUND_HALFODD added to complement existing
330-
NumberFormatter::ROUND_HALFEVEN functionality.
331339
. ResourceBundle::get() now has a tentative return type of:
332340
ResourceBundle|array|string|int|null
333341

@@ -428,6 +436,11 @@ PHP 8.4 UPGRADE NOTES
428436
. sodium_crypto_aead_aes256gcm_*() functions are now enabled on aarch64 CPUs
429437
with the ARM cryptographic extensions.
430438

439+
- Standard:
440+
. Added the http_get_last_response_headers() and
441+
http_clear_last_response_headers() that allows retrieving the same content
442+
as the magic $http_response_header variable.
443+
431444
- XSL:
432445
. Added XSLTProcessor::registerPhpFunctionNS().
433446
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
@@ -436,6 +449,22 @@ PHP 8.4 UPGRADE NOTES
436449
7. New Classes and Interfaces
437450
========================================
438451

452+
- DOM:
453+
. Implemented DOM HTML5 parsing and serialization.
454+
RFC: https://wiki.php.net/rfc/domdocument_html5_parser.
455+
This RFC adds the new DOM namespace along with new classes and
456+
constant aliases.
457+
There are two new classes to handle HTML and XML documents:
458+
DOM\HTMLDocument and DOM\XMLDocument.
459+
These classes provide a cleaner API to handle HTML and XML documents.
460+
Furthermore, the DOM\HTMLDocument class implements spec-compliant HTML5
461+
parsing and serialization.
462+
. Implemented opt-in ext/dom spec compliance RFC.
463+
This adds new classes in the DOM namespace that correspond to modern
464+
equivalents to the old DOM classes in the global namespaces.
465+
The new classes follow the DOM living spec.
466+
RFC: https://wiki.php.net/rfc/opt_in_dom_spec_compliance
467+
439468
========================================
440469
8. Removed Extensions and SAPIs
441470
========================================
@@ -470,6 +499,9 @@ PHP 8.4 UPGRADE NOTES
470499
- Sqlite:
471500
. The class constants are typed now.
472501

502+
- XMLReader:
503+
. The class constants are typed now.
504+
473505
- XSL:
474506
. The typed properties XSLTProcessor::$cloneDocument and
475507
XSLTProcessor::$doXInclude are now declared.
@@ -537,10 +569,14 @@ PHP 8.4 UPGRADE NOTES
537569
* The performance of strspn() and strcspn() is greatly improved.
538570
They now run in linear time instead of being bounded by quadratic time.
539571

572+
* Improved the performance of strpbrk().
573+
540574
* mb_strcut() is much faster now for UTF-8 and UTF-16 strings.
541575

542576
* Looking up mbstring encoding names is much faster now.
543577

544578
* The performance of converting SJIS-win to unicode is greatly improved.
545579

546580
* get_browser() is much faster now, up to 1.5x - 2.5x for some test cases.
581+
582+
* Improved the performance of MySQLnd quoting.

UPGRADING.INTERNALS

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
116116
- M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES).
117117
- M4 macro PHP_SOCKADDR_CHECKS has been removed (use AC_CHECK_TYPES and
118118
AC_CHECK_MEMBERS).
119+
- M4 macro PHP_CHECK_GCC_ARG has been removed since PHP 8.0 (use
120+
AX_CHECK_COMPILE_FLAG).
119121

120122
c. Windows build system changes
121123
- The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19 have
@@ -127,6 +129,9 @@ PHP 8.4 INTERNALS UPGRADE NOTES
127129
- FIBER_ASSEMBLER and FIBER_ASM_ARCH Makefile variables removed in favor of
128130
PHP_ASSEMBLER and FIBER_ASM_ABI.
129131
- HAVE_PHP_SOAP symbol renamed to HAVE_SOAP.
132+
- Unused symbols CONFIGURATION_FILE_PATH, DISCARD_PATH, HAVE_ERRMSG_H,
133+
HAVE_REGCOMP, HAVE_RINT, NEED_ISBLANK, PHP_URL_FOPEN, REGEX, HSREGEX,
134+
USE_CONFIG_FILE have been removed.
130135

131136
========================
132137
3. Module changes
@@ -138,6 +143,12 @@ PHP 8.4 INTERNALS UPGRADE NOTES
138143
- The macros DOM_NO_ARGS() and DOM_NOT_IMPLEMENTED() have been removed.
139144
- New public APIs are available to handle callbacks from XPath, see
140145
xpath_callbacks.h.
146+
- Added public APIs to manipulate namespace data, see namespace_compat.h.
147+
- php_dom_create_object() now no longer accepts a NULL obj argument.
148+
- Removed the `ret` argument from the DOM_RET_OBJ macro, use the return
149+
value instead.
150+
- Removed DOM_XMLNS_NAMESPACE from xml_common.h. Use DOM_XMLNS_NS_URI
151+
from namespace_compat.h instead.
141152

142153
b. ext/random
143154
- The macro RAND_RANGE_BADSCALING() has been removed. The implementation
@@ -154,6 +165,11 @@ PHP 8.4 INTERNALS UPGRADE NOTES
154165
single php_random_algo_with_state struct by value, making it easier to
155166
pass around the state with its associated algorithm and thus reducing
156167
the chance for mistakes.
168+
- The seed member of a php_random_algo has been removed. As a replacement
169+
engine-specific seeding functions are now exposed. This change allows
170+
users to better take engine-specific behavior into account. As an example
171+
Mt19937 ignored the upper half of the seed parameter of the generic
172+
seeding function.
157173
- The CSPRNG API (php_random_(bytes|int)_*) is now provided by the new
158174
and much smaller php_random_csprng.h header. The new header is included
159175
in php_random.h for compatibility with existing users.
@@ -166,6 +182,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
166182
- Added php_libxml_pretend_ctx_error_ex() to emit errors as if they had come
167183
from libxml.
168184
- Removed the "properties" HashTable field from php_libxml_node_object.
185+
- Added a way to attached private data to a php_libxml_ref_obj.
186+
- Added a way to fix a class type onto php_libxml_ref_obj.
169187

170188
e. ext/date
171189
- Added the php_format_date_ex() API to format instances of php_date_obj.
@@ -178,6 +196,9 @@ PHP 8.4 INTERNALS UPGRADE NOTES
178196
When flags should be ignored, pass 0 to the flags argument.
179197
- php_pcre_match_impl() and pcre_get_compiled_regex_cache_ex() now use
180198
proper boolean argument types instead of integer types.
199+
- pcre_get_compiled_regex_cache_ex() now provides an option to collect extra
200+
options (from modifiers used in the expression, for example), and calls
201+
pcre2_set_compile_extra_options() with those options.
181202

182203
========================
183204
4. OpCode changes

0 commit comments

Comments
 (0)