Compare commits

...

268 commits

Author SHA1 Message Date
Alexandre Daubois
e5f81bd74c
spl: Use size_t to store spl_heap’s count (#19482)
Some checks are pending
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
2025-08-15 09:50:49 +02:00
David Carlier
b73d8b373a
Merge branch 'PHP-8.4' 2025-08-15 08:08:16 +01:00
David Carlier
fd4db3e178
Merge branch 'PHP-8.3' into PHP-8.4
Some checks are pending
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
2025-08-15 08:05:14 +01:00
Mark Karpeles
987a3a5c8e
Fix GH-19484 i: potential use after free when using persistent pgsql connections.
Some checks are pending
Push / MACOS_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / FREEBSD (push) Has been skipped
By setting the notice processor to a no-op when a persistent connection is cleaned for future use.

Close GH-19485
2025-08-15 08:04:14 +01:00
Niels Dossche
dcd3ef33b3
Realign entries 2025-08-15 08:41:56 +02:00
Niels Dossche
1bba07ecc0
partitioned option for setcookie/setrawcookie and sessions
RFC: https://wiki.php.net/rfc/CHIPS

Closes GH-12646.
Closes GH-12652.
2025-08-15 08:41:24 +02:00
Gina Peter Banyard
f9d95c649e Update NEWS and UPGRADING for chr() deprecation
Some checks are pending
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
2025-08-14 20:51:30 +01:00
Gina Peter Banyard
cab46b27b9
ext/standard: Deprecate passing integers outside the interval [0, 255] to chr() (#19441)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr
2025-08-14 20:48:48 +01:00
Alexandre Daubois
6009b8a100
Fix GH-19476: pipe operator fails to correctly handle returning by reference (GH-19478)
Some checks are pending
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
2025-08-14 16:34:21 +02:00
Gina Peter Banyard
fb87b14b6c
ext/spl: Deprecate ArrayObject and ArrayIterator with objects (#19420)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects

This also moves tests into a subfolder.
2025-08-14 12:38:57 +01:00
Ilija Tovilo
9c754baa99
Merge branch 'PHP-8.4'
Some checks are pending
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
* PHP-8.4:
  Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
2025-08-14 12:16:16 +02:00
Ilija Tovilo
708d8e9cfd
Merge branch 'PHP-8.3' into PHP-8.4
Some checks are pending
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
* PHP-8.3:
  Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
2025-08-14 12:15:00 +02:00
Ilija Tovilo
a3de2ce9ba
Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
Some checks are pending
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / FREEBSD (push) Has been skipped
Push / MACOS_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Fixes GH-18850
Closes GH-19471
2025-08-14 12:13:50 +02:00
Tim Düsterhus
359f4420a4
Merge branch 'PHP-8.4'
Some checks are pending
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / FREEBSD (push) Has been skipped
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
* PHP-8.4:
  Update GitHub Action workflows to `actions/checkout@v5`
2025-08-13 19:10:23 +02:00
Tim Düsterhus
391d8132b6
Merge branch 'PHP-8.3' into PHP-8.4
Some checks are pending
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
* PHP-8.3:
  Update GitHub Action workflows to `actions/checkout@v5`
2025-08-13 19:09:20 +02:00
Tim Düsterhus
fdd27472de
Merge branch 'PHP-8.2' into PHP-8.3
Some checks are pending
Push / MACOS_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
* PHP-8.2:
  Update GitHub Action workflows to `actions/checkout@v5`
2025-08-13 19:08:30 +02:00
Tim Düsterhus
aa992f36d3
Merge branch 'PHP-8.1' into PHP-8.2
Some checks failed
Push / LINUX_X64_RELEASE_ZTS (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Failing after 1m16s
Push / LINUX_X64_DEBUG_NTS (push) Has been skipped
Push / FREEBSD (push) Has been skipped
Push / MACOS_DEBUG_NTS (push) Has been cancelled
Push / WINDOWS_X64_ZTS (push) Has been cancelled
* PHP-8.1:
  Update GitHub Action workflows to `actions/checkout@v5`
2025-08-13 19:08:06 +02:00
Tim Düsterhus
2650248a92
Update GitHub Action workflows to actions/checkout@v5
Some checks failed
Push / LINUX_X64_RELEASE_ZTS (push) Has been skipped
Push / LINUX_X64_DEBUG_NTS (push) Has been skipped
Push / FREEBSD (push) Has been skipped
Push / MACOS_DEBUG_NTS (push) Has been cancelled
Push / WINDOWS_X64_ZTS (push) Has been cancelled
Keep this up to date in all non-security-only branches, because the node.js
runtime for older versions might get deprecated in the future and fixing this
for all branches at once is easier.

see 45e60e585e
2025-08-13 19:06:09 +02:00
Dmitry Stogov
222f7517a1
Merge branch 'PHP-8.4'
* PHP-8.4:
  Added test for PR #19458
2025-08-13 15:59:57 +03:00
Dmitry Stogov
cbb9ee8f5b
Added test for PR #19458
Thanks to @DanielEScherzer
2025-08-13 15:58:04 +03:00
Ilija Tovilo
fd8dfe1bfd
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16649: Avoid UAF when using array_splice
2025-08-13 14:16:50 +02:00
Ilija Tovilo
7e01cf59bb
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16649: Avoid UAF when using array_splice
2025-08-13 14:16:12 +02:00
Alexandre Daubois
c8774f9e61
Fix GH-16649: Avoid UAF when using array_splice
Closes GH-19399
2025-08-13 14:15:34 +02:00
Alexandre Daubois
bf64dfcd99
Add an enum for HASH_KEY_IS_* constants (GH-19376) 2025-08-13 13:59:01 +02:00
Dmitry Stogov
290c9aef56
Eliminate useless spill stores (#19467) 2025-08-13 13:46:14 +03:00
Calvin Buckley
60047025db
Remove references to ODBCVER and assume ODBC 3.x (#19453)
* Remove references to ODBCVER and assume ODBC 3.x

See https://wiki.php.net/rfc/deprecations_php_8_5#remove_support_for_older_odbc_versions

* Avoid calling deprecated ODBC functions

`SQLGetConnectOption`, `SQLSetConnectOption` and `SQLSetStmtOption` are
deprecated, so if ODBC 3 is available, we use `SQLSetConnectAttr`,
`SQLGetConnectAttr`, and `SQLSetStmtAttr` instead.

(This is based on GH-17556, but just assumes ODBC 3.x.)

* Remove wrappers for SQLColAttribute

We don't need to support the old way of doing it.

* Just call SQLAllocHandle directly

Again, no need for the version specific wrapper

* Update NEWS for ODBCVER in beta2

* [skip ci] UPGRADING for ODBCVER changes

---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2025-08-12 18:05:43 -03:00
Niels Dossche
77dace78c3
[ci skip] Fix UPGRADING formatting 2025-08-12 22:35:47 +02:00
Niels Dossche
841f0b1515
Remove dead error checks for php_stream_filter_alloc() (#19194)
php_stream_filter_alloc() can't fail, so simplify the code.
2025-08-12 22:18:39 +02:00
Jakub Zelenka
ba97d8636a
Merge branch 'PHP-8.4'
Some checks are pending
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
2025-08-12 17:30:07 +02:00
Jakub Zelenka
c8a4207400
Merge branch 'PHP-8.3' into PHP-8.4
Some checks are pending
Push / MACOS_ARM64_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
2025-08-12 17:29:18 +02:00
Jakub Zelenka
2b415e416e
Fix GH-19245: Success error message on TLS stream accept failure
Some checks are pending
Push / MACOS_DEBUG_NTS (push) Waiting to run
Push / WINDOWS_X64_ZTS (push) Waiting to run
Push / LINUX_X64_RELEASE_NTS (push) Has been skipped
Push / LINUX_X64_DEBUG_ZTS_ASAN (push) Has been skipped
Push / LINUX_X32_DEBUG_ZTS (push) Has been skipped
Push / BENCHMARKING (push) Has been skipped
Push / FREEBSD (push) Has been skipped
This overwrites the previous message from the successful accept call.

Closes GH-19246
2025-08-12 17:28:33 +02:00
Eric Mann
b9ae9845ad
Merge branch 'PHP-8.4'
* PHP-8.4:
  PHP-8.3 is now for PHP 8.3.26-dev
2025-08-12 08:19:01 -07:00
Eric Mann
4aa43e2cd3
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  PHP-8.3 is now for PHP 8.3.26-dev
2025-08-12 08:17:38 -07:00
Eric Mann
a0bd2c9fcf
PHP-8.3 is now for PHP 8.3.26-dev 2025-08-12 08:15:40 -07:00
Saki Takamachi
2f9e1adbdd
Merge branch 'PHP-8.4'
* PHP-8.4:
  PHP-8.4 is now for PHP 8.4.13-dev
2025-08-12 23:49:46 +09:00
Saki Takamachi
b7c26eb16c
PHP-8.4 is now for PHP 8.4.13-dev 2025-08-12 23:46:26 +09:00
Volker Dusch
fb7db498fb
[ci skip] Update NEWS for PHP 8.5.0 beta1 2025-08-12 16:31:18 +02:00
Jakub Zelenka
20c8c12d9e
Fix #81724: openssl_cms_encrypt only allows specific ciphers
The allows cipher_algo to be specified as a string. It means the not
only predefined ID ciphers are available which means that also auth
enveloped data can be created using AES GCM.

Closes GH-19459
2025-08-12 15:52:09 +02:00
Jiří Pudil
38beb44176
[RFC] Extend #[\Override] to target properties (#19061)
RFC: https://wiki.php.net/rfc/override_properties

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2025-08-12 15:18:50 +02:00
Daniel Scherzer
c3bee21256
NEWS/UPGRADING for recent deprecations 2025-08-12 06:05:09 -07:00
Daniel Scherzer
57a88b216c
[RFC] Deprecate ReflectionProperty::getDefaultValue() without default (#19457)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-12 05:50:27 -07:00
Daniel Scherzer
ffdc1044c9
[RFC] Deprecate ReflectionClass::getConstant() for missing constants (#19456)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-12 05:50:20 -07:00
Daniel Scherzer
a68f3d6374
[RFC] Deprecate imagedestroy() (#19454)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-12 05:50:09 -07:00
Daniel Scherzer
699e5632b1
[RFC] Deprecate curl_share_close() (#19452)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-12 05:49:52 -07:00
Daniel Scherzer
9b13bb1ae4
[RFC] Deprecate curl_close() (#19451)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-12 05:44:41 -07:00
Daniel Scherzer
4de2ec3895
[RFC] Deprecate xml_parser_free() (#19449)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-12 05:44:32 -07:00
Ilija Tovilo
65c961436d
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Add timeout for FreeBSD
2025-08-12 14:19:11 +02:00
Ilija Tovilo
571bded46e
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Add timeout for FreeBSD
2025-08-12 14:19:04 +02:00
Ilija Tovilo
347723af05
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Add timeout for FreeBSD
2025-08-12 14:18:53 +02:00
Ilija Tovilo
0c044b35b7
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add timeout for FreeBSD
2025-08-12 14:18:44 +02:00
Ilija Tovilo
abb7f2879e
[skip ci] Add timeout for FreeBSD
Unfortunately, these jobs routinely fail to boot correctly. In this case,
they'll stall and block CI for 6 hours until they finally fail. Add a limit to
make them fail earlier.
2025-08-12 14:17:33 +02:00
Gina Peter Banyard
2b5d978a85
Update NEWS and UPGRADING 2025-08-12 11:53:37 +01:00
Jorg Adam Sowa
25cbc15719
RFC: Deprecate date constant RFC7231 (#12989)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231
2025-08-12 11:33:38 +01:00
Alexandre Daubois
dfa1307a64
Various return types and values consolidation (#19418) 2025-08-12 11:28:41 +01:00
Daniel Scherzer
3dc962b9f7
[RFC] Deprecate returning null from __debugInfo() (#19455)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null
2025-08-12 11:15:18 +01:00
Tim Düsterhus
3d9d68e1ca
zend_compile: Deprecate backticks as an alias for shell_exec() (#19443)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec
2025-08-12 12:02:13 +02:00
Derick Rethans
4d6dde595c
Emit EXT_STMT after each pipe stage, and attach the TMP var that holds the intermediary result (#19377)
* Emit EXT_STMT after each pipe stage, and attach the TMP var that holds the intermediary result
* Add ZEND_EXT_STMT to keeps_op1_alive as per review
* Fix leak with EXT_STMT when pipe result is unused

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2025-08-12 10:26:06 +01:00
Dmitry Stogov
07a9c25c71
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix Nightly workflow Symfony assertion (ir_ra.c:326: ir_fix_live_range: Assertion `ival && p->start == old_start' failed) (#19458)
2025-08-12 11:59:26 +03:00
Dmitry Stogov
47f9f3a3f6
Fix Nightly workflow Symfony assertion (ir_ra.c:326: ir_fix_live_range: Assertion `ival && p->start == old_start' failed) (#19458) 2025-08-12 11:59:08 +03:00
Niels Dossche
4d74dd0395
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19065: Long match statement can segfault compiler during recursive SSA renaming
2025-08-11 23:05:56 +02:00
Niels Dossche
8b5231388c
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19065: Long match statement can segfault compiler during recursive SSA renaming
2025-08-11 23:05:50 +02:00
Niels Dossche
9b86533ce4
Fix GH-19065: Long match statement can segfault compiler during recursive SSA renaming
On some systems, like Alpine, the thread stack size is small by default.
The last step of SSA construction involves variable renaming that is
recursive, and also makes copies of their version of the renamed
variables on the stack. This combination causes a stack overflow during
compilation on Alpine. Triggerable for example with very long match
statements.

A stop-gap solution would be to use heap allocated arrays for the
renamed variable list, but that would only delay the error as increasing
the number of match arms increases the depth of the dominator tree, and
will eventually run into the same issue.

This patch transforms the algorithm into an iterative one.
There are two states stored in a worklist stack: positive numbers
indicate that the block still needs to undergo variable renaming.
Negative numbers indicate that the block and its dominated children are
already renamed. Because 0 is also a valid block number, we bias the
block numbers by adding 1.
To restore to the right variant when backtracking the "recursive" step,
we index into an array pointing to the different variable renaming
variants.

Closes GH-19083.
2025-08-11 23:05:21 +02:00
Jakub Zelenka
10834d1572
Fix #47728: Add missing openssl constants
This adds PKCS7_NOSMIMECAP, PKCS7_CRLFEOL, PKCS7_NOCRL and
PKCS7_NO_DUAL_CONTENT constants. They might be potentially useful
in some scenarious.

Test is not added as it is not clear if there is much need for those and
it would require much bigger effort just to test OpenSSL functionality.

Closes GH-19450
2025-08-11 20:46:14 +02:00
Jakub Zelenka
c5f79b8cf9
Use OpenSSL libctx for various BIO readers (#19448)
This converts mostly PEM readers but also DER for CMS
2025-08-11 18:21:38 +02:00
Daniel Scherzer
6280dfc025
UPGRADING: document #[\Attribute] validation from GH-19154
[skip ci]
2025-08-11 09:17:06 -07:00
Daniel Scherzer
c416191a00
GH-19153: Validate #[\Attribute] targets (#19154)
Do not allow #[\Attribute] on traits, interfaces, enums, or abstract classes.
2025-08-11 09:05:57 -07:00
Theodore Brown
5f8d648af6
Deprecate terminating case statements with a semicolon (#19215)
Part of https://wiki.php.net/rfc/deprecations_php_8_5

Closes GH-15258
2025-08-11 14:18:06 +02:00
Tim Düsterhus
d01aa02ef5
UPGRADING: Fix formatting 2025-08-11 13:42:52 +02:00
Jakub Zelenka
702d18de99
Implement #80495: Enable to set padding in openssl_(sign|verify)
This adds support for RSA PSS padding.

Closes GH-19432
2025-08-11 13:11:10 +02:00
Niels Dossche
8f1a627e79
Merge branch 'PHP-8.4'
* PHP-8.4:
  Backport Lexbor changes to 8.4
2025-08-10 14:21:47 +02:00
Niels Dossche
91665eaa63
Backport Lexbor changes to 8.4 2025-08-10 14:17:19 +02:00
Niels Dossche
33d38d059e
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19383: php-8.3.24: Missing type in function definition: fpm_event_kqueue_clean
2025-08-10 13:25:47 +02:00
Niels Dossche
19ffe572bb
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19383: php-8.3.24: Missing type in function definition: fpm_event_kqueue_clean
2025-08-10 13:25:42 +02:00
Niels Dossche
b57578f3b1
Fix GH-19383: php-8.3.24: Missing type in function definition: fpm_event_kqueue_clean
This is just a clean backport.
2025-08-10 13:25:24 +02:00
Niels Dossche
fc86c249dc
Sync with lexbor/lexbor@49b43eba41 (#19442) 2025-08-10 13:16:39 +02:00
Niels Dossche
aecf2a6e62
Fix GH-18877: \Dom\HTMLDocument querySelectorAll selecting only the first when using ~ and :has
Backports lexbor/lexbor@971faf11a5

Closes GH-19180.
2025-08-10 13:07:13 +02:00
Gina Peter Banyard
e990b691c5
Update NEWS and UPGRADING for recent deprecation merges 2025-08-09 23:12:05 +01:00
Gina Peter Banyard
284e622506
ext/openssl: Deprecate $key_length parameter of openssl_pkey_derive() (#19421)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive
2025-08-09 22:55:53 +01:00
Jakub Zelenka
731d36ac61
Fix OpenSSL fetching of alias ciphers
This does not seem like an issue as the aliases seem to be already
fetched most of the time. But there might be cases when it could be
failing like it was failing for MD in GH-19369.

It should be noted that the test does not fail without this change but
it seems useful anyway so it is added as part of this change. I
actually have not found the case where alias is not fetched for cipher
but there might be some.

Closes GH-19437
2025-08-09 23:03:26 +02:00
Jakub Zelenka
066a977840
Clean up test for GH-19369 - openssl_sign issue 2025-08-09 23:02:46 +02:00
Jakub Zelenka
c8d7318daf
Fix GH-19369: openssl_sign() - support for alias digest algs broken
Closes GH-19436
2025-08-09 22:06:59 +02:00
Nikita Popov
bc475ada13 Fix non-canonical casts
They may be deprecated, but they should still produce the correct
type...
2025-08-09 21:40:13 +02:00
Gina Peter Banyard
dc0962c243
ext/standard: Deprecate passing null to readdir(), rewinddir(), and closedir() (#19423)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir
2025-08-09 18:08:21 +01:00
Gina Peter Banyard
ba21ab4ea0
ext/finfo: Deprecate the parameter for finfo_buffer() (#19378)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer
2025-08-09 17:42:19 +01:00
Jakub Zelenka
c064fc4fe8
Fix php_openssl_pkey_derive merge issue 2025-08-09 18:25:42 +02:00
Jakub Zelenka
75931a2ce3
Merge branch 'PHP-8.4' 2025-08-09 18:02:10 +02:00
Jakub Zelenka
f52a59ff4f
Merge branch 'PHP-8.3' into PHP-8.4 2025-08-09 17:44:25 +02:00
Jakub Zelenka
9e2aa658a8
Fix GH-19428: openssl_pkey_derive segfaults for DH derive with low key_length
This happens only for OpenSSL 1.1.1 because key_length is ignored for
DH. It means that the provided string is overwritten with longer buffer.
2025-08-09 17:43:04 +02:00
Gina Peter Banyard
69f67f990d
ext/intl: Deprecate intl.error_level INI setting (#19430)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_intlerror_level_ini_setting
2025-08-09 16:28:47 +01:00
David CARLIER
2bb98cd8c8
ext/int: IntlTimeZone converting few intl error to exceptions. (#13477) 2025-08-09 12:50:35 +01:00
Alexandre Daubois
74c006fbab
Use proper hash_spec_result enum for return values in ext/hash (#19386) 2025-08-09 12:56:40 +02:00
Gina Peter Banyard
d65025b53d
Update NEWS/UPGRADING for recent commits 2025-08-09 11:49:42 +01:00
Gina Peter Banyard
16872310d5
ext/spl: Deprecate SplObjectStorage::contains(), SplObjectStorage::attach(), and SplObjectStorage::detach() (#19424)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach
2025-08-09 11:36:14 +01:00
Gina Peter Banyard
1e108e9ab2
ext/intl: wrap DateTimeZone constructor exception in an IntlException (#19410)
The motivation is two fold:
- Userland code that deals with ext/intl can be expected to handle IntlException but not necessarily ext/date exceptions
- This removes the possibility of superfluous warnings being emitted by ext/intl when an exception has already been thrown
2025-08-09 11:24:11 +01:00
Gina Peter Banyard
8c5c03e33a
ext/spl: Deprecate passing spl_autoload_call() to spl_autoload_unregister() (#19422)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_spl_autoload_call_to_spl_autoload_unregister
2025-08-09 11:23:14 +01:00
Gina Peter Banyard
94a15cc92f
Deprecate the parameter of get_defined_functions() (#19425)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions
2025-08-09 11:22:43 +01:00
Peter Kokot
f64c6248b5
Autotools: Update ax_check_compile_flag.m4 to serial 11 (#19127)
```sh
wget -O build/ax_check_compile_flag.m4 \
  https://cgit.git.savannah.gnu.org/cgit/autoconf-archive.git/plain/m4/ax_check_compile_flag.m4
```

New version of AX_CHECK_COMPILE_FLAG macro now adds the -Werror flag
automatically, if GNU-compatible compiler is detected.
2025-08-09 02:03:37 +02:00
Alexandre Daubois
7bf79ab666
Make spl_filesystem_dir_read() return void (#19419) 2025-08-08 22:14:07 +01:00
Gina Peter Banyard
7b44bfd812
UPGRADING and NEWS for recent 8.5 deprecations 2025-08-08 21:45:02 +01:00
Tim Düsterhus
ccb716dcad
fileinfo: Deprecate finfo_close() (#18396)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close
2025-08-08 21:25:13 +01:00
Tim Düsterhus
922c225fbf
reflection: Deprecate Reflection*::setAccessible() (#19273)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
2025-08-08 21:24:41 +01:00
Tim Düsterhus
732069d98b
pdo: Deprecate the uri: DSN scheme (#19274)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme
2025-08-08 21:24:15 +01:00
Tim Düsterhus
21625006e5
standard: Deprecate socket_set_timeout() (#19285)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout
2025-08-08 21:23:48 +01:00
Tim Düsterhus
5d86515772
mysqli: Deprecate mysqli_execute() (#19286)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute
2025-08-08 21:23:31 +01:00
Gina Peter Banyard
3bf21a0d43
Zend: Deprecate non-canonical cast names (#19372)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_non-standard_cast_names
2025-08-08 21:22:49 +01:00
Gina Peter Banyard
43a91089ca
ext/intl: Refactor timezone parameter passing (#19409) 2025-08-08 21:12:43 +01:00
Niels Dossche
be2889411a
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
2025-08-08 20:33:00 +02:00
Niels Dossche
db3f6d0bf0
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
2025-08-08 20:32:55 +02:00
Niels Dossche
cc93bbb765
Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
The request shutdown does not necessarily hold the last reference, if
there is still a CV that refers to the array.

Closes GH-19405.
2025-08-08 20:32:29 +02:00
Niels Dossche
99e6b0ecc8
Use stack allocation in timezone_initialize() (#19394)
This lives temporarily, avoid overhead and handling of heap allocation.
2025-08-08 20:29:39 +02:00
Alexandre Daubois
9673079903
Fix GH-18404: Display diff when a single test is run (GH-19400) 2025-08-08 19:16:32 +02:00
Arnaud Le Blanc
e4078a6a70
Disable opcache if no SHM backend is available
Currently, configure fails when no SHM backend is available. Additionally,
even after bypassing the configure check, opcache emits a fatal error if no
SHM backend is available.

Make the configure check non-fatal (a warning is printed). At runtime, disable
opcache if no backend is available, in the same way we disable opcache by
default on CLI.

Closes GH-19350
2025-08-08 14:41:37 +02:00
Gina Peter Banyard
fe88711b14
ext/intl: Use ZPP specifier for IntlTimeZone::createEnumeration() (#19393)
The existing code is extremely convoluted, incorrectly documented, and does not follow the usual semantics
2025-08-07 22:37:16 +01:00
David CARLIER
140fc69b4a
ext/intl: update from C to C++ step2. (#19294) 2025-08-07 22:36:34 +01:00
Gina Peter Banyard
c5143c0b22
tree: remove some usages of the report_memleaks INI setting (#19407) 2025-08-07 22:17:24 +01:00
Gina Peter Banyard
1f131e3ae6
[skip ci] ext/sockets: remove tests that leak memory (#19408)
I don't understand what the purposes of theses tests are.
2025-08-07 21:50:04 +01:00
Niels Dossche
a3f34043de
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19371: integer overflow in calendar.c
2025-08-07 19:09:03 +02:00
Niels Dossche
11e6655624
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19371: integer overflow in calendar.c
2025-08-07 19:08:58 +02:00
Niels Dossche
5cf45ba5ab
Fix GH-19371: integer overflow in calendar.c
Closes GH-19380.
2025-08-07 19:08:32 +02:00
Gina Peter Banyard
43420599f7
ext/intl: better errors for IntlTimeZone::createTimeZoneIDEnumeration (#19395)
IntlTimeZone::createTimeZoneIDEnumeration

And convert those to ValueErrors directly as they are bugs
2025-08-07 13:52:03 +01:00
Gina Peter Banyard
ca5667bc14
ext/intl: prevent creation of invalid UConverter instance (#19396) 2025-08-07 13:46:58 +01:00
Ilija Tovilo
abe75ca850
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix ERROR_CODE handling in COMMUNITY build
2025-08-07 13:56:19 +02:00
Ilija Tovilo
db5a3956f5
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix ERROR_CODE handling in COMMUNITY build
2025-08-07 13:56:12 +02:00
Ilija Tovilo
aae35f3617
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix ERROR_CODE handling in COMMUNITY build
2025-08-07 13:56:06 +02:00
Ilija Tovilo
080ba20d49
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix ERROR_CODE handling in COMMUNITY build
2025-08-07 13:55:59 +02:00
Ilija Tovilo
2cd9233e42
Fix ERROR_CODE handling in COMMUNITY build
We need || because a non-0 return from the application aborts the execution of
the job.
2025-08-07 13:54:55 +02:00
Arnaud Le Blanc
17826d31c6
Merge branch 'PHP-8.4'
* PHP-8.4:
  zend call stack fixing stack limit for macOs arm64.
2025-08-07 08:42:03 +02:00
Arnaud Le Blanc
58501bd136
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  zend call stack fixing stack limit for macOs arm64.
2025-08-07 08:41:24 +02:00
David Carlier
bd2766ce79
zend call stack fixing stack limit for macOs arm64.
8MB sounded a prudent size for older 10.9 macOs release, however
with newer mac with arm64, it triggers a stack overflow.

Cherry picks b320aabc5e (GH-13319) from PHP-8.4.
Closes GH-19390.
2025-08-07 08:38:40 +02:00
Arnaud Le Blanc
d1fceeec30
Check stack limit in fuzzer executor
The stack limit is checked when entering execute_ex(), but the fuzzer has
its own execute function and does not call execute_ex().

Add a stack limit check in the fuzzer's execute function.

Closes GH-19391
2025-08-07 08:32:02 +02:00
Gina Peter Banyard
c42e6d62d8
ext/intl: modernize tests (#19392)
This is effectively removing ZPP tests, enabling warnings, and moving INI settings into the INI PHPT block
2025-08-06 23:33:48 +01:00
Gina Peter Banyard
3fc0149325
[skip ci] drop invalid IntlDateFormat construction error test
The date.timezone INI setting defaults to UTC if an invalid value is provided, meaning that we construct a valid object with timezone UTC.
2025-08-06 22:15:06 +01:00
Ilija Tovilo
77eac5ec82
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Bump retries in benchmark diff when looking for benchmarked commits
2025-08-06 22:29:49 +02:00
Ilija Tovilo
0c303b2043
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Bump retries in benchmark diff when looking for benchmarked commits
2025-08-06 22:29:36 +02:00
Ilija Tovilo
44618752f9
[skip ci] Bump retries in benchmark diff when looking for benchmarked commits 2025-08-06 22:28:56 +02:00
Ilija Tovilo
c69f04dbab
Fix borked test 2025-08-06 22:25:14 +02:00
Gina Peter Banyard
aa9694bdd0
ext/date: null bytes in timezones can only happen via HT initialization (#19357)
Thus check this error condition early in the HT initialization code.
2025-08-06 21:02:25 +01:00
Arnaud Le Blanc
7af4709d38
Fix test 2025-08-06 19:57:32 +02:00
Arnaud Le Blanc
c105571052
Fix test 2025-08-06 19:55:56 +02:00
Arnaud Le Blanc
b7ac56822d
Fix build 2025-08-06 19:50:11 +02:00
Arnaud Le Blanc
32290b3529
Add opcache_preloading() internal function
Add a C function, opcache_preloading(), that returns true during
preloading. Extensions can use this to detect preloading, not only during
compilation/execution, but also in RINIT()/RSHUTDOWN().

Since opcache currently doesn't install any header, I'm adding a new one:
zend_accelerator_api.h. Header name is based on other files in ext/opcache.

Closes GH-19288
2025-08-06 18:21:19 +02:00
Arnaud Le Blanc
3088d64068
Remove the Opcache SAPI whitelist
Closes GH-19351
2025-08-06 18:14:10 +02:00
Arnaud Le Blanc
3ddbad9589
Allocate a fast thread-safe-resource id for opcache
Closes GH-19347
2025-08-06 18:02:43 +02:00
Gina Peter Banyard
5583273906 ext/ldap: Use size_t type instead of int type 2025-08-06 16:36:13 +01:00
Gina Peter Banyard
61790eb8a0 ext/ldap: Use uint32_t type instead of int type 2025-08-06 16:36:13 +01:00
Gina Peter Banyard
9af00b174a ext/ldap: Use bool type instead of int type 2025-08-06 16:36:13 +01:00
Gina Peter Banyard
53fde8b5a8 ext/ldap: Remove useless variable 2025-08-06 16:36:13 +01:00
Gina Peter Banyard
b5fb9555e1 ext/ldap: Reduce scope of variable 2025-08-06 16:36:13 +01:00
Gina Peter Banyard
1c820750da ext/ldap: Add static specifier for private function 2025-08-06 16:36:13 +01:00
Gina Peter Banyard
2e53aef1e8 ext/ldap: Remove unused include statement 2025-08-06 16:36:13 +01:00
Ilija Tovilo
e30a8a883f
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Fix Symfony COMMUNITY build for new phpunit version
2025-08-06 15:10:23 +02:00
Ilija Tovilo
c3467bd173
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Fix Symfony COMMUNITY build for new phpunit version
2025-08-06 15:10:17 +02:00
Ilija Tovilo
3aa4209ef6
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Fix Symfony COMMUNITY build for new phpunit version
2025-08-06 15:10:07 +02:00
Ilija Tovilo
a8cea0c09b
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Fix Symfony COMMUNITY build for new phpunit version
2025-08-06 15:10:01 +02:00
Ilija Tovilo
0ac37fb74d
[skip ci] Fix Symfony COMMUNITY build for new phpunit version
--exclude-group no longer accepts a comma-separated list. Doc block comments are
no longer supported, switch to attributes.
2025-08-06 15:07:45 +02:00
Ilija Tovilo
81c0aeaf5d
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Skip segfaulting OOM test in GH actions on Win
2025-08-06 14:29:46 +02:00
Ilija Tovilo
0b1aa86c71
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Skip segfaulting OOM test in GH actions on Win
2025-08-06 14:29:36 +02:00
Ilija Tovilo
5be04e25fd
[skip ci] Skip segfaulting OOM test in GH actions on Win
This only fails on the PHP-8.3 branch, most likely to be related to the
environment as discussed with Niels.
2025-08-06 14:28:47 +02:00
Ilija Tovilo
63cb81ff2c
Merge branch 'PHP-8.4'
* PHP-8.4:
  COMMUNTIY build grouping adjustments
2025-08-06 14:20:39 +02:00
Ilija Tovilo
d628ed5963
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  COMMUNTIY build grouping adjustments
2025-08-06 14:20:32 +02:00
Gina Peter Banyard
1e0c8baf05
tree: drop non canonical casts and ZPP tests 2025-08-06 13:20:28 +01:00
Ilija Tovilo
bf6a74d2f9
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  COMMUNTIY build grouping adjustments
2025-08-06 14:20:26 +02:00
Ilija Tovilo
9cbc09d189
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  COMMUNTIY build grouping adjustments
2025-08-06 14:20:17 +02:00
Ilija Tovilo
a63e97667e
COMMUNTIY build grouping adjustments
Unconditionally execute assignment of EXIT_CODE. Otherwise, the variable bleeds
into the next iteration. Also add newline before ::endgroup::. ASAN does not add
a trailing newline.
2025-08-06 14:18:43 +02:00
Ilija Tovilo
14034ad734
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Add fuzzer binaries to .gitignore
2025-08-06 14:01:32 +02:00
Ilija Tovilo
e7c8361089
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Add fuzzer binaries to .gitignore
2025-08-06 14:01:25 +02:00
Ilija Tovilo
c286cb8a1e
[skip ci] Add fuzzer binaries to .gitignore 2025-08-06 14:00:44 +02:00
Shivam Mathur
4a934005b4
Fix Windows test for openssl-3.5 upgrade (#19384)
* Fix Windows test for openssl-3.5 upgrade

* Update ext/openssl/tests/check_default_conf_path.phpt

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2025-08-06 16:11:38 +05:30
Derick Rethans
a9ab62d54d
Add a brief section on options to the test runner, and -j 2025-08-06 10:05:27 +01:00
Derick Rethans
0c82801384
Setting TEST_PHP_EXECUTABLE hasn't been necessary for ages. 2025-08-06 09:48:46 +01:00
Shivam Mathur
1820dd9b61 Merge branch 'PHP-8.4' 2025-08-06 00:05:47 +00:00
Shivam Mathur
6147be32fc Merge branch 'PHP-8.3' into PHP-8.4 2025-08-06 00:05:28 +00:00
Shivam Mathur
f08ac4f1c9 Merge branch 'PHP-8.2' into PHP-8.3 2025-08-06 00:04:58 +00:00
Shivam Mathur
871de14ceb Merge branch 'PHP-8.1' into PHP-8.2 2025-08-06 00:03:49 +00:00
Shivam Mathur
8199cad99f
Fix master branch check in find-target-branch.bat (#19385) 2025-08-06 05:32:36 +05:30
David CARLIER
d801a4634f
Fixed GH-19381: posix_kill_pidoverflow test depends on pcntl too. (#19382) 2025-08-05 20:03:21 +01:00
David CARLIER
9ccd2ba9ff
Fixed GH-19163 fix ext/intl build on midly older compilers but still supporting C++11. (#19353) 2025-08-05 19:09:37 +01:00
Gina Peter Banyard
5b3d0e4c09 ext/json: Refactor php_json_encode_array()
Stop relying on internal flags which were published in the header
Use a more descriptive variable name and have it be a boolean
2025-08-05 18:21:15 +01:00
Gina Peter Banyard
17328ef86b ext/json: Various small refactorings 2025-08-05 18:21:15 +01:00
Gina Peter Banyard
d9000b3094
tree: replace some unnecessary uses of spprintf (#19354) 2025-08-05 17:25:47 +01:00
Ilija Tovilo
0596135d20
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Group component output in community job
2025-08-05 15:44:36 +02:00
Ilija Tovilo
fbc705c3bd
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Group component output in community job
2025-08-05 15:44:21 +02:00
Ilija Tovilo
cdfd663266
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Group component output in community job
2025-08-05 15:44:07 +02:00
Ilija Tovilo
dde094a442
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Group component output in community job
2025-08-05 15:43:58 +02:00
Ilija Tovilo
1c65cc3998
[skip ci] Group component output in community job 2025-08-05 15:43:46 +02:00
Gina Peter Banyard
d0274e74f8 Zend/zend_ast: Use uint32_t type instead of int type 2025-08-05 12:43:18 +01:00
Gina Peter Banyard
8512514a0f Zend/zend_ast: Use zend_ast_get_list() instead of cast 2025-08-05 12:43:18 +01:00
Gina Peter Banyard
36ec3370fb Zend/zend_ast: Add const qualifier 2025-08-05 12:43:18 +01:00
Ilija Tovilo
d8e014dfbe
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Add zend_jit_arm64.c to gitignore
2025-08-04 23:12:48 +02:00
Ilija Tovilo
9f800aedfe
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Add zend_jit_arm64.c to gitignore
2025-08-04 23:12:33 +02:00
Ilija Tovilo
bfd42b060d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Add zend_jit_arm64.c to gitignore
2025-08-04 23:12:22 +02:00
Ilija Tovilo
f077c9d233
[skip ci] Add zend_jit_arm64.c to gitignore
This is not generated in CI since moving to macOS 14, which is arm based.
2025-08-04 23:12:09 +02:00
Ilija Tovilo
541a1e69d5
Merge branch 'PHP-8.4'
* PHP-8.4:
  Upgrade to macOS 14 and backport necessary changes
2025-08-04 22:21:58 +02:00
Ilija Tovilo
44d63a8ac0
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Upgrade to macOS 14 and backport necessary changes
2025-08-04 22:21:21 +02:00
Ilija Tovilo
234159d911
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Upgrade to macOS 14 and backport necessary changes
2025-08-04 22:20:06 +02:00
Ilija Tovilo
7ba4453f8f
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Upgrade to macOS 14 and backport necessary changes
2025-08-04 22:19:59 +02:00
Ilija Tovilo
e9e432a35d
Upgrade to macOS 14 and backport necessary changes 2025-08-04 22:12:30 +02:00
Ilija Tovilo
0d15bca041
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix filtering of INI directives to respect leading whitespaces
2025-08-04 16:56:59 +02:00
Ilija Tovilo
bd7ffc911d
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix filtering of INI directives to respect leading whitespaces
2025-08-04 16:56:51 +02:00
Arndt Kaiser
9d29283392
Fix filtering of INI directives to respect leading whitespaces
Directives are now correctly filtered out if the line in the php.ini
file begins with whitespace characters.

Closes GH-19348
2025-08-04 16:55:46 +02:00
Gina Peter Banyard
4d5bdef21a streams: refactor statbuf_from_array() 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
9e334af6e4 streams: use type php_socket_t instead of type int 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
a02b2b8eb6 streams: use %zu printf specifier for size_t
Rather than casting to zend_long
2025-08-04 15:30:57 +01:00
Gina Peter Banyard
051414bec6 streams: use an enum for return type of _php_stream_make_seekable() 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
93ec0ac0f3 streams: drop unused includes 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
fa85b38560 streams: voidify php_stream_filter_prepend_ex()
This only ever returned SUCCESS
2025-08-04 15:30:57 +01:00
Gina Peter Banyard
cd13ba73e2 streams: use RETURN_BOOL() when possible 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
b46c5e6186 streams: refactor implementation of stream_select() 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
c50a715a5c streams: remove useless casts 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
0d0f774a6a streams: use call in if statement directly 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
fb2585f4e2 streams: use -1 directly instead of FAILURE macro
The result of the functions returning those globals is never checked anyway
2025-08-04 15:30:57 +01:00
Gina Peter Banyard
4b6ebcc6e9 streams: remove confusing step variable 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
02af9acfca streams: use precomputed persistant variable 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
67d6160462 streams: use int type instead of long
The flags variable is passed to the filter virtual function that requires an int
2025-08-04 15:30:57 +01:00
Gina Peter Banyard
c9836b03ce streams: use type size_t instead of type unsigned int 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
841afdc486 streams: use type zend_result instead of type int 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
b3551cc31f streams: use type bool instead of type int 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
b35dbe474e streams: reduce scope of variables 2025-08-04 15:30:57 +01:00
Gina Peter Banyard
17b8706bf6 streams: add const specifier 2025-08-04 15:30:57 +01:00
Dmitry Stogov
ef98a6e723
Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-08-04 17:26:46 +03:00
Dmitry Stogov
ac1cd9c26e
Update IR
IR commit: 6e2aea0ebfef2c741ebec30c57aa492df0d4e319
2025-08-04 17:26:24 +03:00
Alexandre Daubois
433c00b348
[skip ci] tree: Fix various typos (#19366) 2025-08-04 15:15:52 +01:00
Ilija Tovilo
cd80ed6f7b
Implement changes to GH-17951 according to ML discussion 2025-08-04 16:04:25 +02:00
Frederik Milling Pytlick
4e21924271
Fix GH-17951: Addition of max_memory_limit INI
Closes GH-18011
2025-08-04 16:04:25 +02:00
Arnaud Le Blanc
9aa8e8825f
Remove zend_jit_vm_kind (#19299)
JIT used to not have a compile-time dependency on VM kind, such that a single
build of opcache could work with different VM kinds at runtime. This has been broken
over time and would be difficult to restore. Additionally, as opcache is now
built-in, this would not be useful anymore.

Remove the zend_jit_vm_kind variable.
2025-08-04 15:52:09 +02:00
Máté Kocsis
98e0dbcefe
Opcache is always available in the previous commit of the real time benchmark
Now that there's one measured run after opcache is always enabled, we can change the PHP_OPCACHE back to 1.
2025-08-03 21:00:19 +02:00
Gina Peter Banyard
a66b631bce
main/php_ini: various minor refactorings (#19339) 2025-08-03 17:30:12 +01:00
Gina Peter Banyard
961412d6f2
main: refactor implementation of set_time_limit() (#19338) 2025-08-03 16:17:00 +01:00
Alexandre Daubois
345e04b619
[skip ci] Fix typos in NEWS, UPGRADING and UPGRADING.INTERNALS (#19341) 2025-08-02 20:36:39 +02:00
Máté Kocsis
55a3e33bb1
Do not allow concurrent runs of the real time benchmark
Closes GH-19345
2025-08-01 11:38:30 +02:00
Máté Kocsis
776d6f8660
Add valgrind instruction count meansurement support to manual benchmark flow 2025-08-01 11:34:31 +02:00
Máté Kocsis
e8f88e746b
Fixes the real time benchmark
First of all, the last successful build had been before opcache was made required - therefore the PHP_OPCACHE setting should be 2 to manually enable it.

Then, the manual flow should comment on the PR of the triggering repo (github.repository), not the repo of the benchmarked code (env.REPOSITORY).
2025-08-01 10:12:38 +02:00
Daniel Scherzer
6f630a882d
NEWS/UPGRADING: fix missing __ in __toString()
Forgotten by yours truly in 36ae82b73e

[skip ci]
2025-07-31 17:38:23 -07:00
Daniel Scherzer
63f9e4945d
GH-17927: Indicate virtual properties and hooks in reflection output (#19297) 2025-07-31 17:32:09 -07:00
Gina Peter Banyard
105c1e9896
tree: use zend_str_has_nul_byte() API (#19336) 2025-07-31 23:57:27 +01:00
Gina Peter Banyard
2c4d4a6f18
ext/odbc: various minor refactorings (#19337) 2025-07-31 23:56:27 +01:00
Calvin Buckley
18dee43e02
Add SAPI_HEADER_DELETE_PREFIX, make ext/session use it (#18678)
* Add SAPI_HEADER_DELETE_PREFIX operation

The session ext currently munges into the linked list of headers
itself, because the delete header API is given the key for headers to
delete. The session ext wants to use a prefix past the colon separator,
for i.e. "Set-Cookie: PHPSESSID=", to eliminate only the specific cookie
rather than all cookies.

This changes the SAPI code to add a new header op to take a prefix
instead. Call sites are yet unchanged. Also fix some whitespace.

* Simplify cookie setting code in ext/session

Use the modern SAPI header ops API, including the remove prefix op we
just added.

* [ci skip] Remove redundant and unnecessary comment

The purpose of this is clear, and after refactoring, the special case is
no longer there, so it has no value.

* Un-deprecate simple add/replace header API, use it

Suggestion from Jakub.

* Restore the optimization removing session cookies had

I don't think this needs to be special cased with the parameter.

* Move setting header length to caller

Suggestion from Jakub.

* [ci skip] adjust tab count

It may be better to use spaces in here instead.

* Use session_cookie_len rather than calling strlen
2025-07-31 19:52:04 -03:00
Ilija Tovilo
a262419398
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix circumvented type check with return by ref + finally
2025-08-01 00:36:38 +02:00
Ilija Tovilo
b3f4863373
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix circumvented type check with return by ref + finally
2025-08-01 00:36:28 +02:00
Ilija Tovilo
d0fad34230
Fix circumvented type check with return by ref + finally
Fixes GH-18736
Closes GH-19172
2025-08-01 00:35:48 +02:00
Gina Peter Banyard
65b9cf1db3
ext/standard/proc_open.c: Minor refactorings (#18085)
Add const modifier
Use unsigned types when the source type is unsigned
Use HashTable instead of zvals where possible
2025-07-31 23:02:35 +01:00
Máté Kocsis
ada10741b4
Add support for manually running the real-time benchmark on PRs (#19265)
[skip-ci]
2025-07-31 22:51:38 +02:00
Niels Dossche
15990de89e
Refactor op array loops in JIT (#19335)
Reuse the helper zend_foreach_op_array() that we move to the
zend_optimizer.h header to be usable in opcache.
Note that applying this to other op_array loops is not easy because they either:
- start from EG(persistent_classes_count)
- or only apply to classes
2025-07-31 22:10:06 +02:00
Ilija Tovilo
0afa04a474
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix stale nInternalPosition on rehashing
2025-07-31 21:56:00 +02:00
Ilija Tovilo
5d40592fe2
Fix stale nInternalPosition on rehashing
Since GH-13188 we're no longer immediately updating iterator positions when
deleting array elements. zend_hash_rehash() needs to adapt accordingly by
adjusting nInternalPosition for IS_UNDEF elements. This is already the case for
array iterators.

Fixes GH-19280
Closes GH-19323
2025-07-31 21:55:08 +02:00
Alexandre Daubois
e43074a1d8
Rename poorly named tests in Zend/tests (#19332)
And move some into their relevant folders
2025-07-31 19:58:01 +01:00
Gina Peter Banyard
dad28a30f3
main: pack _php_netstream_data_t and use bool instead of int type (#19331)
Fix use sites at the same time
2025-07-31 19:56:38 +01:00
Niels Dossche
0591defd6f
Merge branch 'PHP-8.4'
* PHP-8.4:
  Remove dynamic defs from property hooks
  Add missing hooks JIT restart code
2025-07-31 20:22:20 +02:00
Niels Dossche
771bfaf34d
Remove dynamic defs from property hooks
Otherwise this hits an assertion failure in pass2 reversal and causes a
subsequent crash.

Closes GH-19206.
2025-07-31 20:22:11 +02:00
Niels Dossche
9ce51dad8b
Add missing hooks JIT restart code
Closes GH-19207.
2025-07-31 20:21:40 +02:00
Niels Dossche
cee8ed235a
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19300: Nested array_multisort invocation with error breaks
2025-07-31 19:01:28 +02:00
Niels Dossche
b82c8ba7fe
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19300: Nested array_multisort invocation with error breaks
2025-07-31 19:01:13 +02:00
Niels Dossche
a96b05e63f
Fix GH-19300: Nested array_multisort invocation with error breaks
There are 2 issues:
1. When a MULTISORT_ABORT happens, it frees func, but func may point to
   ARRAYG(multisort_func), which would be a problem with nested
   invocations as it can destroy that of the "parent" invocation.
   To solve this, delay assigning to the globals.
2. The old globals were not restored which means that nested invocations
   with different flags will cause a wrong sorting function to be used.

Closes GH-19319.
2025-07-31 19:00:45 +02:00
Arnaud Le Blanc
659f55a617
Merge branch 'PHP-8.4'
* PHP-8.4:
  Prevent throwing in running generator
2025-07-31 14:29:25 +02:00
Arnaud Le Blanc
781d77ac54
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Prevent throwing in running generator
2025-07-31 14:29:01 +02:00
Arnaud Le Blanc
6fa8a25a40
Prevent throwing in running generator
Generator::throw() on a running generator is not allowed. It throws "Cannot
resume an already running generator" when trying to resume the generator to
handle the provided exception.

However, when calling Generator::throw() on a generator with a non-Generator
delegate, we release the delegate regardless. If a Fiber was suspended in
the delegate, this causes use after frees when the Fiber is resumed.

Fix this by throwing "Cannot resume an already running generator" earlier.

Fixes GH-19326
Closes GH-19327
2025-07-31 14:26:41 +02:00
Gina Peter Banyard
9db21e18ad
main/streams/transports.c: remove useless cast (#19330)
The function pointer type declaration requires name to be a const char*
2025-07-31 12:44:58 +01:00
Ilija Tovilo
049651dccc
Fix incorrect anonymous class type name assertion (#19316)
Since GH-17755 self and parent are compile-time resolved. We may now also
encounter this type error at runtime outside of the class itself.

Fixes GH-19304
2025-07-31 13:27:28 +02:00
Remi Collet
bdffded054
Ensure no blacklist configured in test (#19325) 2025-07-31 10:38:46 +02:00
Arnaud Le Blanc
37a59e55e8
Merge branch 'PHP-8.4'
* PHP-8.4:
  Prevent resumption of generator suspended in yield from
2025-07-31 08:47:37 +02:00
Arnaud Le Blanc
a430ee2dd2
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Prevent resumption of generator suspended in yield from
2025-07-31 08:46:06 +02:00
Arnaud Le Blanc
0406a55c92
Prevent resumption of generator suspended in yield from
Normally we prevent generators from being resumed while they are already
running, but we failed to do so for generators delegating to non-Generators. As
a result such generator can be resumed, terminated, which causes unexpected
results (crashes) later.

In gh19306.phpt in particular, the generator delegate It::getIterator() suspends
while being called by generator g(). We then resume g(), which throws while
trying to resume It::getIterator(). This causes g() and It::getIterator()
to be released. We then UAF when resuming the Fiber in It::getIterator().

Fix this by ensuring that generators are marked as running while they fetch
the next value from the delegate.

Fixes GH-19306
Closes GH-19315
2025-07-31 08:45:19 +02:00
Jakub Zelenka
e1cf66b6cb
Fix release process feature freeze info (#19148) 2025-07-30 23:51:28 +02:00
Daniel Scherzer
0fc62310b1
AllowDynamicProperties: use fully qualified name in validation errors (#19296) 2025-07-30 14:50:40 -07:00
Daniel Scherzer
246e8e53ba
[ci skip] Update NEWS to reflect PHP 8.5.0 alpha 4 2025-07-30 13:55:45 -07:00
Niels Dossche
a5219c1ecc
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19303: Unpacking empty packed array into uninitialized array causes assertion failure
2025-07-30 22:49:08 +02:00
Niels Dossche
a08df32f18
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19303: Unpacking empty packed array into uninitialized array causes assertion failure
2025-07-30 22:48:59 +02:00
Niels Dossche
5bd5f352e5
Fix GH-19303: Unpacking empty packed array into uninitialized array causes assertion failure
Having an empty result array is not a problem, because zend_hash_extend()
will initialize it. Except it does not when the number of elements to add
equals 0, which leaves the array uninitialized and therefore does not
set the packed flag, causing the assertion failure.

Technically, removing the assert would also work and save a check.
On the other hand, this check could also prevent some real work to be
done and should be relatively cheap as we already have to compute the
sum anyway.

Closes GH-19318.
2025-07-30 22:47:11 +02:00
1024 changed files with 12439 additions and 9333 deletions

View file

@ -17,7 +17,7 @@ jobs:
if: github.repository == 'php/php-src'
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Install dependencies
run: pip install -r docs/requirements.txt
- name: Check formatting

View file

@ -54,7 +54,7 @@ jobs:
runs-on: [self-hosted, gentoo, ppc64]
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: System info
@ -95,7 +95,7 @@ jobs:
image: 'alpine:3.20.1'
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: apk
@ -206,7 +206,7 @@ jobs:
runs-on: ubuntu-${{ matrix.asan && inputs.asan_ubuntu_version || inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: Create MSSQL container
@ -306,7 +306,7 @@ jobs:
FIREBIRD_PASSWORD: test
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: apt
@ -374,7 +374,7 @@ jobs:
runs-on: macos-${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: brew
@ -449,7 +449,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: Create MSSQL container
@ -502,7 +502,7 @@ jobs:
USE_TRACKED_ALLOC: 1
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: apt
@ -553,14 +553,17 @@ jobs:
repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server"
X=0
for repository in $repositories; do
printf "Testing amp/%s\n" "$repository"
echo "::group::$repository"
git clone "https://github.com/amphp/$repository.git" "amphp-$repository" --depth 1
cd "amphp-$repository"
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
EXIT_CODE=0
vendor/bin/phpunit || EXIT_CODE=$?
echo -e "\n::endgroup::"
if [ ${EXIT_CODE:-0} -gt 128 ]; then
X=1;
echo "Failed"
fi
cd ..
done
@ -584,14 +587,17 @@ jobs:
repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream"
X=0
for repository in $repositories; do
printf "Testing reactphp/%s\n" "$repository"
echo "::group::$repository"
git clone "https://github.com/reactphp/$repository.git" "reactphp-$repository" --depth 1
cd "reactphp-$repository"
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
EXIT_CODE=0
vendor/bin/phpunit || EXIT_CODE=$?
echo -e "\n::endgroup::"
if [ $[EXIT_CODE:-0} -gt 128 ]; then
X=1;
echo "Failed"
fi
cd ..
done
@ -616,15 +622,19 @@ jobs:
php /usr/bin/composer install --no-progress --ignore-platform-req=php+
php ./phpunit install
# Test causes a heap-buffer-overflow but I cannot reproduce it locally...
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
# Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("public function testCastNonTrailingCharPointer()", "/** @group skip */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("public function testCastNonTrailingCharPointer()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
X=0
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$?
echo "::group::$component"
EXIT_CODE=0
php ./phpunit $component --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group transient --exclude-group skip || EXIT_CODE=$?
echo -e "\n::endgroup::"
if [ ${EXIT_CODE:-0} -gt 128 ]; then
X=1;
echo "Failed"
fi
done
exit $X
@ -695,7 +705,7 @@ jobs:
runs-on: ubuntu-${{ inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: Create MSSQL container
@ -758,7 +768,7 @@ jobs:
runs-on: ubuntu-${{ inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: apt
@ -849,7 +859,7 @@ jobs:
runs-on: ubuntu-${{ inputs.ubuntu_version }}
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: apt
@ -899,38 +909,38 @@ jobs:
CXX: ccache g++
steps:
- name: git checkout PHP
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: php
ref: ${{ inputs.branch }}
- name: git checkout apcu
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: krakjoe/apcu
path: apcu
- name: git checkout imagick
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: Imagick/imagick
path: imagick
- name: git checkout memcached
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: php-memcached-dev/php-memcached
path: memcached
- name: git checkout redis
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: phpredis/phpredis
path: redis
- name: git checkout xdebug
if: false
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: xdebug/xdebug
path: xdebug
- name: git checkout yaml
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: php/pecl-file_formats-yaml
path: yaml
@ -1040,7 +1050,7 @@ jobs:
- name: git config
run: git config --global core.autocrlf false && git config --global core.eol lf
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: Setup
@ -1058,9 +1068,10 @@ jobs:
- zts: ${{ !inputs.run_freebsd_zts && true || '*never*' }}
name: "FREEBSD_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: FreeBSD

View file

@ -82,7 +82,7 @@ jobs:
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: apt
uses: ./.github/actions/apt-x64
- name: System info
@ -166,7 +166,7 @@ jobs:
FIREBIRD_PASSWORD: test
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: apt
uses: ./.github/actions/apt-x32
- name: ccache
@ -203,7 +203,7 @@ jobs:
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: brew
uses: ./.github/actions/brew
- name: ccache
@ -250,7 +250,7 @@ jobs:
- name: git config
run: git config --global core.autocrlf false && git config --global core.eol lf
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup
uses: ./.github/actions/setup-windows
- name: Build
@ -264,7 +264,7 @@ jobs:
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
# ASLR can cause a lot of noise due to missed sse opportunities for memcpy
@ -326,7 +326,7 @@ jobs:
mysql -uroot -proot -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress'; FLUSH PRIVILEGES;"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'wordpress'@'localhost' WITH GRANT OPTION;"
- name: git checkout benchmarking-data
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: php/benchmarking-data
ssh-key: ${{ secrets.BENCHMARKING_DATA_DEPLOY_KEY }}
@ -366,8 +366,9 @@ jobs:
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
name: FREEBSD
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: FreeBSD
uses: ./.github/actions/freebsd

View file

@ -2,14 +2,94 @@ name: Real-time Benchmark
on:
schedule:
- cron: "30 0 * * *"
workflow_dispatch:
inputs:
pull_request:
description: 'PR number that is going to be benchmarked (e.g. "1234")'
required: true
type: number
jit:
description: 'Whether JIT is benchmarked'
required: false
default: "0"
type: choice
options:
- "0"
- "1"
instruction_count:
description: 'Whether Valgrind instruction count should be measured'
required: true
default: "0"
type: choice
options:
- "0"
- "1"
opcache:
description: 'Whether opcache is enabled for the benchmarked commit'
required: true
default: "1"
type: choice
options:
- "0"
- "1"
- "2"
baseline_opcache:
description: 'Whether opcache is enabled for the baseline commit'
required: true
default: "1"
type: choice
options:
- "0"
- "1"
- "2"
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
REAL_TIME_BENCHMARK:
name: REAL_TIME_BENCHMARK
if: github.repository == 'php/php-src'
if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
env:
REPOSITORY: ${{ github.repository }}
BRANCH: "master"
COMMIT: ${{ github.sha }}
BASELINE_COMMIT: "d5f6e56610c729710073350af318c4ea1b292cfe"
ID: "master"
OPCACHE: ${{ inputs.opcache || '1' }}
BASELINE_OPCACHE: ${{ inputs.baseline_opcache || '2' }}
JIT: ${{ inputs.jit || '1' }}
INSTRUCTION_COUNT: ${{ inputs.instruction_count || '0' }}
YEAR: ""
steps:
- name: Setup benchmark environment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
YEAR="$(date '+%Y')"
echo "YEAR=$YEAR" >> $GITHUB_ENV
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
PR_INFO=$(gh pr view ${{ inputs.pull_request }} --json headRepositoryOwner,headRepository,headRefName,headRefOid,baseRefOid --repo ${{ github.repository }} | jq -r '.headRepositoryOwner.login, .headRepository.name, .headRefName, .headRefOid, .baseRefOid')
REPOSITORY="$(echo "$PR_INFO" | sed -n '1p')/$(echo "$PR_INFO" | sed -n '2p')"
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV
BRANCH=$(echo "$PR_INFO" | sed -n '3p')
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
COMMIT=$(echo "$PR_INFO" | sed -n '4p')
echo "COMMIT=$COMMIT" >> $GITHUB_ENV
BASELINE_COMMIT=$(echo "$PR_INFO" | sed -n '5p')
echo "BASELINE_COMMIT=$BASELINE_COMMIT" >> $GITHUB_ENV
echo "ID=benchmarked" >> $GITHUB_ENV
fi
- name: Install dependencies
run: |
set -ex
@ -23,79 +103,149 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y terraform=1.5.7-*
- name: Checkout benchmark suite
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: 'kocsismate/php-version-benchmarks'
ref: 'main'
fetch-depth: 1
path: 'php-version-benchmarks'
- name: Checkout php-src
uses: actions/checkout@v4
- name: Checkout php-src (benchmarked version)
uses: actions/checkout@v5
with:
repository: 'php/php-src'
ref: '${{ github.sha }}'
repository: '${{ env.REPOSITORY }}'
ref: '${{ env.COMMIT }}'
fetch-depth: 100
path: 'php-version-benchmarks/tmp/php_master'
path: 'php-version-benchmarks/tmp/php_${{ env.ID }}'
- name: Checkout php-src (baseline version)
uses: actions/checkout@v5
with:
repository: '${{ env.REPOSITORY }}'
ref: '${{ env.BASELINE_COMMIT }}'
fetch-depth: 100
path: 'php-version-benchmarks/tmp/php_baseline'
- name: Setup benchmark results
run: |
git config --global user.name "Benchmark"
git config --global user.email "benchmark@php.net"
rm -rf ./php-version-benchmarks/docs/results
- name: Checkout benchmark data
uses: actions/checkout@v4
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v5
with:
repository: php/real-time-benchmark-data
ssh-key: ${{ secrets.PHP_VERSION_BENCHMARK_RESULTS_DEPLOY_KEY }}
path: 'php-version-benchmarks/docs/results'
- name: Set benchmark config
- name: Setup infra config
run: |
set -e
# Set infrastructure config
cp ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini.dist ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini
ESCAPED_DOCKER_REGISTRY=$(printf '%s\n' "${{ secrets.PHP_VERSION_BENCHMARK_DOCKER_REGISTRY }}" | sed -e 's/[\/&]/\\&/g')
sed -i "s/INFRA_DOCKER_REGISTRY=public.ecr.aws\/abcdefgh/INFRA_DOCKER_REGISTRY=$ESCAPED_DOCKER_REGISTRY/g" ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini
sed -i "s/INFRA_MEASURE_INSTRUCTION_COUNT=0/INFRA_MEASURE_INSTRUCTION_COUNT=${{ env.INSTRUCTION_COUNT }}/g" ./php-version-benchmarks/config/infra/aws/x86_64-metal.ini
cp ./php-version-benchmarks/build/infrastructure/config/aws.tfvars.dist ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
sed -i 's/access_key = ""/access_key = "${{ secrets.PHP_VERSION_BENCHMARK_AWS_ACCESS_KEY }}"/g' ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
sed -i 's/secret_key = ""/secret_key = "${{ secrets.PHP_VERSION_BENCHMARK_AWS_SECRET_KEY }}"/g' ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
sed -i 's/github_token = ""/github_token = "${{ secrets.GITHUB_TOKEN }}"/g' ./php-version-benchmarks/build/infrastructure/config/aws.tfvars
- name: Setup PHP config - baseline PHP version
run: |
set -e
YEAR="$(date '+%Y')"
DATABASE="./php-version-benchmarks/docs/results/$YEAR/database.tsv"
BASELINE_SHORT_SHA="$(echo "${{ env.BASELINE_COMMIT }}" | cut -c1-4)"
cat << EOF > ./php-version-benchmarks/config/php/baseline.ini
PHP_NAME="PHP - baseline@$BASELINE_SHORT_SHA"
PHP_ID=php_baseline
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.BASELINE_COMMIT }}
PHP_OPCACHE=${{ env.BASELINE_OPCACHE }}
PHP_JIT=0
EOF
- name: Setup PHP config - baseline PHP version with JIT
if: github.event_name == 'workflow_dispatch' && inputs.jit == '1'
run: |
set -e
BASELINE_SHORT_SHA="$(echo "${{ env.BASELINE_COMMIT }}" | cut -c1-4)"
cat << EOF > ./php-version-benchmarks/config/php/baseline_jit.ini
PHP_NAME="PHP - baseline@$BASELINE_SHORT_SHA (JIT)"
PHP_ID=php_baseline_jit
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.BASELINE_COMMIT }}
PHP_OPCACHE=${{ env.BASELINE_OPCACHE }}
PHP_JIT=${{ env.JIT }}
EOF
git clone ./php-version-benchmarks/tmp/php_baseline/ ./php-version-benchmarks/tmp/php_baseline_jit
- name: Setup PHP config - previous PHP version
if: github.event_name != 'workflow_dispatch'
run: |
set -e
DATABASE="./php-version-benchmarks/docs/results/${{ env.YEAR }}/database.tsv"
if [ -f "$DATABASE" ]; then
LAST_RESULT_SHA="$(tail -n 2 "$DATABASE" | head -n 1 | cut -f 6)"
else
YESTERDAY="$(date -d "-2 day 23:59:59" '+%Y-%m-%d %H:%M:%S')"
LAST_RESULT_SHA="$(cd ./php-version-benchmarks/tmp/php_master/ && git --no-pager log --until="$YESTERDAY" -n 1 --pretty='%H')"
LAST_RESULT_SHA="$(cd ./php-version-benchmarks/tmp/php_${{ env.ID }}/ && git --no-pager log --until="$YESTERDAY" -n 1 --pretty='%H')"
fi
BASELINE_SHA="d5f6e56610c729710073350af318c4ea1b292cfe"
BASELINE_SHORT_SHA="$(echo "$BASELINE_SHA" | cut -c1-4)"
cat << EOF > ./php-version-benchmarks/config/php/previous.ini
PHP_NAME="PHP - previous ${{ env.BRANCH }}"
PHP_ID=php_previous
# Set config for the baseline PHP version
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_baseline.ini
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - baseline@'"$BASELINE_SHORT_SHA"'"/g' ./php-version-benchmarks/config/php/master_baseline.ini
sed -i "s/PHP_ID=php_master/PHP_ID=php_master_baseline/g" ./php-version-benchmarks/config/php/master_baseline.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=$BASELINE_SHA/g" ./php-version-benchmarks/config/php/master_baseline.ini
sed -i "s/PHP_OPCACHE=1/PHP_OPCACHE=2/g" ./php-version-benchmarks/config/php/master_baseline.ini
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=$LAST_RESULT_SHA
# Set config for the previous PHP version
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_last.ini
sed -i 's/PHP_NAME="PHP - master"/PHP_NAME="PHP - previous master"/g' ./php-version-benchmarks/config/php/master_last.ini
sed -i "s/PHP_ID=php_master/PHP_ID=php_master_previous/g" ./php-version-benchmarks/config/php/master_last.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=$LAST_RESULT_SHA/g" ./php-version-benchmarks/config/php/master_last.ini
sed -i "s/PHP_OPCACHE=1/PHP_OPCACHE=2/g" ./php-version-benchmarks/config/php/master_last.ini
PHP_OPCACHE=1
PHP_JIT=0
EOF
- name: Setup PHP config - benchmarked PHP version
run: |
set -e
# Set config for the current PHP version
cp ./php-version-benchmarks/config/php/master.ini.dist ./php-version-benchmarks/config/php/master_now.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=${{ github.sha }}/g" ./php-version-benchmarks/config/php/master_now.ini
cat << EOF > ./php-version-benchmarks/config/php/this.ini
PHP_NAME="PHP - ${{ env.BRANCH }}"
PHP_ID=php_${{ env.ID }}
# Set config for current PHP version with JIT
git clone ./php-version-benchmarks/tmp/php_master/ ./php-version-benchmarks/tmp/php_master_jit
cp ./php-version-benchmarks/config/php/master_jit.ini.dist ./php-version-benchmarks/config/php/master_now_jit.ini
sed -i "s/PHP_COMMIT=/PHP_COMMIT=${{ github.sha }}/g" ./php-version-benchmarks/config/php/master_now_jit.ini
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.COMMIT }}
PHP_OPCACHE=${{ env.OPCACHE }}
PHP_JIT=0
EOF
- name: Setup PHP config - benchmarked PHP version with JIT
if: env.JIT == '1'
run: |
set -e
cat << EOF > ./php-version-benchmarks/config/php/this_jit.ini
PHP_NAME="PHP - ${{ env.BRANCH }} (JIT)"
PHP_ID=php_${{ env.ID }}_jit
PHP_REPO=https://github.com/${{ env.REPOSITORY }}.git
PHP_BRANCH=${{ env.BRANCH }}
PHP_COMMIT=${{ env.COMMIT }}
PHP_OPCACHE=${{ env.OPCACHE }}
PHP_JIT=${{ env.JIT }}
EOF
git clone ./php-version-benchmarks/tmp/php_${{ env.ID }}/ ./php-version-benchmarks/tmp/php_${{ env.ID }}_jit
- name: Setup test config
run: |
set -e
# Set test configs
cp ./php-version-benchmarks/config/test/1_laravel.ini.dist ./php-version-benchmarks/config/test/1_laravel.ini
cp ./php-version-benchmarks/config/test/2_symfony_main.ini.dist ./php-version-benchmarks/config/test/2_symfony_main.ini
cp ./php-version-benchmarks/config/test/4_wordpress.ini.dist ./php-version-benchmarks/config/test/4_wordpress.ini
@ -104,6 +254,7 @@ jobs:
- name: Run benchmark
run: ./php-version-benchmarks/benchmark.sh run aws
- name: Store results
if: github.repository == 'php/php-src' && github.event_name != 'workflow_dispatch'
run: |
set -ex
@ -119,6 +270,21 @@ jobs:
fi
git commit -m "Add result for ${{ github.repository }}@${{ github.sha }}"
git push
- name: Upload artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: results
path: ./php-version-benchmarks/docs/results/${{ env.YEAR }}
retention-days: 30
- name: Comment results
if: github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ./php-version-benchmarks/tmp/php_${{ env.ID }}
NEWEST_RESULT_DIRECTORY=$(ls -td ${{ github.workspace }}/php-version-benchmarks/docs/results/${{ env.YEAR }}/*/ | head -1)
gh pr comment ${{ inputs.pull_request }} --body-file "${NEWEST_RESULT_DIRECTORY}result.md" --repo ${{ github.repository }}
- name: Cleanup
if: always()
run: |

View file

@ -13,7 +13,7 @@ jobs:
outputs:
branches: ${{ steps.set-matrix.outputs.branches }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Set fetch-depth to 0 to clone the full repository
# including all branches. This is required to find

1
.gitignore vendored
View file

@ -131,6 +131,7 @@ config.h.in
/sapi/cgi/php-cgi
/sapi/fpm/php-fpm
/sapi/phpdbg/phpdbg
/sapi/fuzzer/php-fuzz-*
/scripts/php-config
/scripts/phpize
php

135
NEWS
View file

@ -1,23 +1,130 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.5.0beta1
?? ??? ????, PHP 8.5.0beta2
- Core:
. Fixed bug GH-19305 (Operands may be being released during comparison).
(Arnaud)
. Fixed bug GH-18850 (Repeated inclusion of file with __halt_compiler()
triggers "Constant already defined" warning). (ilutov)
. Fixed bug GH-19476 (pipe operator fails to correctly handle returning
by reference). (alexandre-daubois)
- ODBC:
. Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley)
- OpenSSL:
. Implement #81724 (openssl_cms_encrypt only allows specific ciphers).
(Jakub Zelenka)
- Session:
. Added support for partitioned cookies. (nielsdos)
- Standard:
. Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois)
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
(Girgias)
. Added support for partitioned cookies. (nielsdos)
14 Aug 2025, PHP 8.5.0beta1
- Core:
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
been deprecated. (Girgias)
. The $exclude_disabled parameter of the get_defined_functions() function has
been deprecated, as it no longer has any effect since PHP 8.0. (Girgias)
. Terminating case statements with a semicolon instead of a colon has
been deprecated. (theodorejb)
. The backtick operator as an alias for shell_exec() has been deprecated.
(timwolla)
. Returning null from __debugInfo() has been deprecated. (DanielEScherzer)
. Support #[\Override] on properties. (Jiří Pudil)
- Curl:
. The curl_close() function has been deprecated. (DanielEScherzer)
. The curl_share_close() function has been deprecated. (DanielEScherzer)
- Date:
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
deprecated. (jorgsowa)
- DOM:
. Fixed bug GH-18877 (\Dom\HTMLDocument querySelectorAll selecting only the
first when using ~ and :has). (nielsdos, lexborisov)
- FileInfo
. The finfo_close() function has been deprecated. (timwolla)
. The $context parameter of the finfo_buffer() function has been deprecated
as it is ignored. (Girgias)
- GD:
. The imagedestroy() function has been deprecated. (DanielEScherzer)
- Intl:
. Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb)
. Intl's internal error mechanism has been modernized so that it
indicates more accurately which call site caused what error.
Moreover, some ext/date exceptions have been wrapped inside a
IntlException now. (Girgias)
. The intl.error_level INI setting has been deprecated. (Girgias)
- Opcache:
. Fixed bug GH-19301 (opcache build failure). (Remi)
- MySQLi:
. The mysqli_execute() alias function has been deprecated. (timwolla)
31 Jul 2025, PHP 8.5.0alpha3
- OpenSSL:
. Fixed bug GH-19369 (8.5 | Regression in openssl_sign() - support for alias
algorithms appears to be broken). (Jakub Zelenka)
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
(Girgias)
. Implement #80495 (Enable to set padding in openssl_(sign|verify).
(Jakub Zelenka)
. Implement #47728 (openssl_pkcs7_sign ignores new openssl flags).
(Jakub Zelenka)
- PDO:
. The "uri:" DSN scheme has been deprecated due to security concerns with
DSNs coming from remote URIs. (timwolla)
- Reflection:
. Fixed bug GH-17927 (Reflection: have some indication of property hooks in
`_property_string()`). (DanielEScherzer)
. The setAccessible() methods of various Reflection objects have been
deprecated, as those no longer have an effect. (timwolla)
. ReflectionClass::getConstant() for constants that do not exist has been
deprecated. (DanielEScherzer)
. ReflectionProperty::getDefaultValue() for properties without default values
has been deprecated. (DanielEScherzer)
- SPL:
. Unregistering all autoloaders by passing the spl_autoload_call() function
as a callback argument to spl_autoload_unregister() has been deprecated.
Instead if this is needed, one should iterate over the return value of
spl_autoload_functions() and call spl_autoload_unregister() on each
value. (Girgias)
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
SplObjectStorage::detach() methods have been deprecated in favour of
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
SplObjectStorage::offsetUnset() respectively. (Girgias)
- Standard:
. The socket_set_timeout() alias function has been deprecated. (timwolla)
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
opened directory has been deprecated. (Girgias)
. Fixed bug GH-19153 (#[\Attribute] validation should error on
trait/interface/enum/abstract class). (DanielEScherzer)
- XML:
. The xml_parser_free() function has been deprecated. (DanielEScherzer)
31 Jul 2025, PHP 8.5.0alpha4
- Core:
. Add clone-with support to the clone() function. (timwolla, edorian)
. Fix support for non-userland stream notifiers. (timwolla)
. Added PHP_BUILD_PROVIDER constant. (timwolla)
. Fixed bug GH-19305 (Operands may be being released during comparison).
(Arnaud)
. Fixed bug GH-19306 (Generator can be resumed while fetching next value from
delegated Generator). (Arnaud)
. Fixed bug GH-19326 (Calling Generator::throw() on a running generator with
a non-Generator delegate crashes). (Arnaud)
- Curl:
. Add support for CURLINFO_CONN_ID in curl_getinfo() (thecaliskan)
@ -32,6 +139,7 @@ PHP NEWS
- Intl:
. Fix return value on failure for resourcebundle count handler. (Girgias)
. Fixed bug GH-19307 (PGO builds of shared ext-intl are broken). (cmb)
- OPcache:
. Disallow changing opcache.memory_consumption when SHM is already set up.
@ -41,6 +149,7 @@ PHP NEWS
. Make OPcache non-optional (Arnaud, timwolla)
. Fixed bug GH-17422 (OPcache bypasses the user-defined error handler for
deprecations). (Arnaud, timwolla)
. Fixed bug GH-19301 (opcache build failure). (Remi)
- OpenSSL:
. Add $digest_algo parameter to openssl_public_encrypt() and
@ -124,7 +233,7 @@ PHP NEWS
- CURL:
. Added CURLFOLLOW_ALL, CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY
values for CURLOPT_FOLLOLOCATION curl_easy_setopt option. (David Carlier)
values for CURLOPT_FOLLOWLOCATION curl_easy_setopt option. (David Carlier)
- COM:
. Fixed property access of PHP objects wrapped in variant. (cmb)
@ -243,7 +352,7 @@ PHP NEWS
- OpenSSL:
. Added openssl.libctx INI that allows to select the OpenSSL library context
type and convert verious parts of the extension to use the custom libctx.
type and convert various parts of the extension to use the custom libctx.
(Jakub Zelenka)
- Output:
@ -253,7 +362,7 @@ PHP NEWS
. Extend pcntl_waitid with rusage parameter. (vrza)
- PCRE:
. Upgraded to pre2lib from 10.44 to 10.45. (nielsdos)
. Upgraded to pcre2lib from 10.44 to 10.45. (nielsdos)
. Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options.
(mvorisek)
@ -299,7 +408,7 @@ PHP NEWS
(DanielEScherzer)
. Fixed bug GH-12856 (ReflectionClass::getStaticPropertyValue() returns UNDEF
zval for uninitialized typed properties). (nielsdos)
. Fixed bug GH-15766 (ReflectionClass::toString() should have better output
. Fixed bug GH-15766 (ReflectionClass::__toString() should have better output
for enums). (DanielEScherzer)
. Added ReflectionProperty::getMangledName() method. (alexandre-daubois)
@ -362,7 +471,7 @@ PHP NEWS
(David Carlier)
- Sodium:
. Fix overall theorical overflows on zend_string buffer allocations.
. Fix overall theoretical overflows on zend_string buffer allocations.
(David Carlier/nielsdos)
- Sqlite:
@ -391,7 +500,7 @@ PHP NEWS
(cmb)
- Tests:
. Allow to shuffle tests even in non-parallell mode. (dhuang00)
. Allow to shuffle tests even in non-parallel mode. (dhuang00)
- Tidy:
. tidy::__construct/parseFile/parseString methods throw an exception if

163
UPGRADING
View file

@ -50,6 +50,9 @@ PHP 8.5 UPGRADE NOTES
immediately, without calling user-defined error handlers.
. Exceptions thrown by user-defined error handlers when handling class linking
errors are not promoted to fatal errors anymore and do not prevent linking.
. Applying #[\Attribute] to an abstract class, enum, interface, or trait triggers
an error during compilation. Previously, the attribute could be added, but when
ReflectionAttribute::newInstance() was called an error would be thrown.
- DOM:
. Cloning a DOMNamedNodeMap, DOMNodeList, Dom\NamedNodeMap, Dom\NodeList,
@ -77,6 +80,10 @@ PHP 8.5 UPGRADE NOTES
. Calling the mysqli constructor on an already-constructed object
is now no longer possible and throws an Error.
- ODBC:
. ODBC now assumes that at least ODBC 3.5 functionality is available. The
ODBCVER definition and build system flags to control it have been removed.
- Opcache:
. The Opcache extension is now always built into the PHP binary and is always
loaded. The INI directives opcache.enable and opcache.enable_cli are still
@ -175,6 +182,8 @@ PHP 8.5 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/pipe-operator-v3
. Constructor property promotion can now be used for final properties.
RFC: https://wiki.php.net/rfc/final_promotion
. #[\Override] can now be applied to properties.
RFC: https://wiki.php.net/rfc/override_properties
- Curl:
. Added support for share handles that are persisted across multiple PHP
@ -244,6 +253,11 @@ PHP 8.5 UPGRADE NOTES
Pdo_Sqlite::EXPLAIN_MODE_PREPARED, Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN,
Pdo_Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN.
- Session:
. session_set_cookie_params(), session_get_cookie_params(), and session_start()
now support partitioned cookies via the "partitioned" key.
RFC: https://wiki.php.net/rfc/CHIPS
- SOAP:
. Enumeration cases are now dumped in __getTypes().
. Implemented request #61105:
@ -263,15 +277,15 @@ PHP 8.5 UPGRADE NOTES
and the function returns false. Previously, these errors were silently
ignored. This change affects only the sendmail transport.
. getimagesize() now supports HEIF/HEIC images.
- Standard:
. getimagesize() now supports SVG images when ext-libxml is also loaded.
Similarly, image_type_to_extension() and image_type_to_extension()
Similarly, image_type_to_extension() and image_type_to_mime_type()
now also handle IMAGETYPE_SVG.
. The array returned by getimagesize() now has two additional entries:
"width_unit" and "height_unit" to indicate in which units the dimensions
are expressed. These units are px by default. They are not necessarily
the same (just to give one example: one may be cm and the other may be px).
. setcookie() and setrawcookie() now support the "partitioned" key.
RFC: https://wiki.php.net/rfc/CHIPS
- XSL:
. The $namespace argument of XSLTProcessor::getParameter(),
@ -316,12 +330,115 @@ PHP 8.5 UPGRADE NOTES
one will still be used. If a user output handler returns a non-string and
produces output, the warning about producing an output is emitted first.
RFC: https://wiki.php.net/rfc/deprecations_php_8_4
. Non-canonical cast names (boolean), (integer), (double), and (binary) have
been deprecated, use (bool), (int), (float), and (string) respectively.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_non-standard_cast_names
. The $exclude_disabled parameter of the get_defined_functions() function has
been deprecated, as it no longer has any effect since PHP 8.0.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions
. Terminating case statements with a semicolon instead of a colon has
been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_semicolon_after_case_in_switch_statement
. The backtick operator as an alias for shell_exec() has been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_backticks_as_an_alias_for_shell_exec
. Returning null from __debugInfo() has been deprecated.
Return an empty array instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null
- Curl:
. The curl_close() function has been deprecated, as CurlHandle objects are
freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_close
. The curl_share_close() function has been deprecated, as CurlShareHandle
objects are freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_curl_share_close
- Date:
. The DATE_RFC7231 and DateTimeInterface::RFC7231 constants have been
deprecated. This is because the associated timezone is ignored and always
uses GMT.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_date_rfc7231_and_datetimeinterfacerfc7231
- FileInfo:
. The finfo_close() function has been deprecated.
As finfo objects are freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close
. The $context parameter of the finfo_buffer() function has been deprecated
as it is ignored.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_context_parameter_for_finfo_buffer
- GD:
. The imagedestroy() function has been deprecated, as GdImage objects are
freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy
- Hash:
. The MHASH_* constants have been deprecated. These have been overlooked
when the mhash*() function family has been deprecated per
https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family
- Intl:
. The intl.error_level INI setting has been deprecated.
Errors should either be checked manually or exceptions should be enabled
by using the intl.use_exceptions INI setting.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_intlerror_level_ini_setting
- MySQLi:
. The mysqli_execute() alias function has been deprecated.
Use mysqli_stmt_execute() instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute
- OpenSSL:
. The $key_length parameter for openssl_pkey_derive() has been deprecated.
This is because it is either ignored, or truncates the key, which can be
a vulnerability.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_key_length_parameter_of_openssl_pkey_derive
- PDO:
. The "uri:" DSN scheme has been deprecated due to security concerns with
DSNs coming from remote URIs.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_pdo_s_urischeme
- Reflection:
. The setAccessible() methods of various Reflection objects have been
deprecated, as those no longer have an effect.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
. Calling ReflectionClass::getConstant() for constants that do not exist has
been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionclassgetconstant_for_missing_constants
. Calling ReflectionProperty::getDefaultValue() for properties without default
values has been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionpropertygetdefaultvalue_for_properties_without_default_values
- SPL:
. Unregistering all autoloaders by passing the spl_autoload_call() function
as a callback argument to spl_autoload_unregister() has been deprecated.
Instead if this is needed, one should iterate over the return value of
spl_autoload_functions() and call spl_autoload_unregister() on each value.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_spl_autoload_call_to_spl_autoload_unregister
. The SplObjectStorage::contains(), SplObjectStorage::attach(), and
SplObjectStorage::detach() methods have been deprecated in favour of
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
SplObjectStorage::offsetUnset() respectively.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach
- Standard:
. The socket_set_timeout() alias function has been deprecated.
Use stream_set_timeout() instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_socket_set_timeout
. Passing null to to readdir(), rewinddir(), and closedir() to use the last
opened directory has been deprecated. Provide the last opened directory
explicitly instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_null_to_readdir_rewinddir_and_closedir
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
This is because a byte can only hold a value within this interval.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_integers_outside_the_interval_0_255_to_chr
- XML:
. The xml_parser_free() function has been deprecated, as XMLParser objects
are freed automatically.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_xml_parser_free
========================================
5. Changed Functions
========================================
@ -348,7 +465,12 @@ PHP 8.5 UPGRADE NOTES
- OpenSSL:
. openssl_public_encrypt() and openssl_private_decrypt() have new parameter
$digest_algo that allows specifying hash digest algorith for OEAP padding.
$digest_algo that allows specifying hash digest algorithm for OEAP padding.
. openssl_sign() and openssl_verify() have new parameter $padding to allow
using more secure RSA PSS padding.
. openssl_cms_encrypt() $cipher_algo parameter can be a string with the
cipher name. That allows to use more algorithms including AES GCM cipher
algorithms for auth enveloped data.
- PCNTL:
. pcntl_exec() now has a formal return type of false.
@ -391,14 +513,19 @@ PHP 8.5 UPGRADE NOTES
argument are lower than -1 or if soft_limit is greater than hard_limit.
- Reflection:
. The output of ReflectionClass::toString() for enums has changed to
. The output of ReflectionClass::__toString() for enums has changed to
better indicate that the class is an enum, and that the enum cases
are enum cases rather than normal class constants.
. The output of ReflectionProperty::__toString() for properties with
hooks has changed to indicate what hooks the property has, whether those
hooks are final, and whether the property is virtual. This also affects
the output of ReflectionClass::__toString() when a class contains hooked
properties.
- Session:
. session_start is stricter in regard to the option argument.
It throws a ValueError if the whole is not a hashmap or
a TypeError if read_on_close value is not a valid type
a TypeError if read_and_close value is not a valid type
compatible with int.
- SNMP:
@ -541,6 +668,12 @@ PHP 8.5 UPGRADE NOTES
. The return type of finfo_close() has been changed to true, rather
than bool.
- Intl:
. Intl's internal error mechanism has been modernized so that it
indicates more accurately which call site caused what error.
Moreover, some ext/date exceptions have been wrapped inside a
IntlException now.
- Lexbor:
. An always enabled lexbor extension is added. It contains the lexbor
library that was separated from ext/dom for being reused among other
@ -590,6 +723,13 @@ PHP 8.5 UPGRADE NOTES
. DECIMAL_COMPACT_SHORT.
. DECIMAL_COMPACT_LONG.
- OpenSSL:
. OPENSSL_PKCS1_PSS_PADDING
. PKCS7_NOSMIMECAP
. PKCS7_CRLFEOL
. PKCS7_NOCRL
. PKCS7_NO_DUAL_CONTENT
- POSIX:
. POSIX_SC_OPEN_MAX.
@ -624,6 +764,11 @@ PHP 8.5 UPGRADE NOTES
. Added fatal_error_backtraces to control whether fatal errors should include
a backtrace.
RFC: https://wiki.php.net/rfc/error_backtraces_v2
. Added startup-only max_memory_limit INI setting to control the maximum
memory_limit that may be configured at startup or runtime. Exceeding this
value emits a warning, unless set to -1, and sets memory_limit to the
current max_memory_limit instead.
ML discussion: https://externals.io/message/127108
- Opcache:
. Added opcache.file_cache_read_only to support a read-only
@ -643,9 +788,9 @@ PHP 8.5 UPGRADE NOTES
showing misleading values in PHPInfo.
- OpenSSL:
Added openssl.libctx to select the OpenSSL library context type. Either
custom libctx for each thread can be used or a single global (default)
libctx is used.
. Added openssl.libctx to select the OpenSSL library context type. Either
custom libctx for each thread can be used or a single global (default)
libctx is used.
========================================
12. Windows Support

View file

@ -29,6 +29,10 @@ PHP 8.5 INTERNALS UPGRADE NOTES
be heap-allocated and stored in the pointer as a minimal change to keep
compatibility.
- Hash
. Hash functions now use proper hash_spec_result enum for return values
instead of using SUCCESS and FAILURE.
- Zend
. Added zend_safe_assign_to_variable_noref() function to safely assign
a value to a non-reference zval.
@ -75,6 +79,7 @@ PHP 8.5 INTERNALS UPGRADE NOTES
delayed. Before, errors would be recorded but not delayed.
. zend_mm_refresh_key_child() must be called on any zend_mm_heap inherited
from the parent process after a fork().
. HASH_KEY_IS_* constants have been moved in the zend_hash_key_type enum.
- standard
. ext/standard/php_smart_string.h and ext/standard/php_smart_string_public.h
@ -96,11 +101,12 @@ PHP 8.5 INTERNALS UPGRADE NOTES
that appropriate build rules are created.
- Unix build system changes
. libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex lib64)
. libdir is properly set when --libdir (ex: /usr/lib64) and --with-libdir (ex: lib64)
configure options are used to ${libdir}/php (ex: /usr/lib64/php)
. PHP_ODBC_CFLAGS, PHP_ODBC_LFLAGS, PHP_ODBC_LIBS, PHP_ODBC_TYPE preprocessor
macros defined by ext/odbc are now defined in php_config.h instead of the
build-defs.h header.
. Autoconf macro AX_CHECK_COMPILE_FLAG updated to serial 11.
. Autoconf macro PHP_AP_EXTRACT_VERSION has been removed.
. Autoconf macro PHP_BUILD_THREAD_SAFE has been removed (set enable_zts
manually).

View file

@ -420,6 +420,14 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
}
break;
case ZEND_EXT_STMT:
if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
/* Variable will be deleted later by FREE, so we can't optimize it */
Tsource[VAR_NUM(opline->op1.var)] = NULL;
break;
}
break;
case ZEND_CASE:
case ZEND_CASE_STRICT:
case ZEND_COPY_TMP:

View file

@ -98,6 +98,10 @@ ZEND_API int zend_optimizer_register_pass(zend_optimizer_pass_t pass);
ZEND_API void zend_optimizer_unregister_pass(int idx);
zend_result zend_optimizer_startup(void);
zend_result zend_optimizer_shutdown(void);
typedef void (*zend_op_array_func_t)(zend_op_array *, void *context);
void zend_foreach_op_array(zend_script *script, zend_op_array_func_t func, void *context);
END_EXTERN_C()
#endif

View file

@ -128,7 +128,4 @@ int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zen
int dce_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *optimizer_ctx, zend_ssa *ssa, bool reorder_dtor_effects);
zend_result zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa);
typedef void (*zend_op_array_func_t)(zend_op_array *, void *context);
void zend_foreach_op_array(zend_script *script, zend_op_array_func_t func, void *context);
#endif

View file

@ -22,6 +22,7 @@
#include "zend_ssa.h"
#include "zend_dump.h"
#include "zend_inference.h"
#include "zend_worklist.h"
#include "Optimizer/zend_optimizer_internal.h"
static bool dominates(const zend_basic_block *blocks, int a, int b) {
@ -816,7 +817,7 @@ ZEND_API int zend_ssa_rename_op(const zend_op_array *op_array, const zend_op *op
}
/* }}} */
static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */
static void zend_ssa_rename_in_block(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n) /* {{{ */
{
zend_basic_block *blocks = ssa->cfg.blocks;
zend_ssa_block *ssa_blocks = ssa->blocks;
@ -824,15 +825,6 @@ static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build
int ssa_vars_count = ssa->vars_count;
int i, j;
zend_op *opline, *end;
int *tmp = NULL;
ALLOCA_FLAG(use_heap = 0);
// FIXME: Can we optimize this copying out in some cases?
if (blocks[n].next_child >= 0) {
tmp = do_alloca(sizeof(int) * (op_array->last_var + op_array->T), use_heap);
memcpy(tmp, var, sizeof(int) * (op_array->last_var + op_array->T));
var = tmp;
}
if (ssa_blocks[n].phis) {
zend_ssa_phi *phi = ssa_blocks[n].phis;
@ -916,22 +908,90 @@ static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build
}
ssa->vars_count = ssa_vars_count;
}
/* }}} */
j = blocks[n].children;
while (j >= 0) {
// FIXME: Tail call optimization?
if (zend_ssa_rename(op_array, build_flags, ssa, var, j) == FAILURE)
return FAILURE;
j = blocks[j].next_child;
static zend_result zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa, int *var, int n)
{
/* The worklist contains block numbers, encoded as positive or negative value.
* Positive values indicate that the variable rename still needs to happen for the block.
* Negative values indicate the variable rename was done and all children were handled too.
* In that case, we will clean up.
* Because block 0 is valid, we bias the block numbers by adding 1 such that we can distinguish
* positive and negative values in all cases. */
zend_worklist_stack work;
ALLOCA_FLAG(work_use_heap);
ZEND_WORKLIST_STACK_ALLOCA(&work, ssa->cfg.blocks_count, work_use_heap);
zend_worklist_stack_push(&work, n + 1);
/* This is used to backtrack the right version of the renamed variables to use. */
ALLOCA_FLAG(save_vars_use_heap);
unsigned int save_vars_top = 0;
int **save_vars = do_alloca(sizeof(int *) * (ssa->cfg.blocks_count + 1), save_vars_use_heap);
save_vars[0] = var;
while (work.len) {
n = zend_worklist_stack_pop(&work);
/* Enter state: perform SSA variable rename */
if (n > 0) {
n--;
// FIXME: Can we optimize this copying out in some cases?
int *new_var;
if (ssa->cfg.blocks[n].next_child >= 0) {
new_var = emalloc(sizeof(int) * (op_array->last_var + op_array->T));
memcpy(new_var, save_vars[save_vars_top], sizeof(int) * (op_array->last_var + op_array->T));
save_vars[++save_vars_top] = new_var;
} else {
new_var = save_vars[save_vars_top];
}
zend_ssa_rename_in_block(op_array, build_flags, ssa, new_var, n);
int j = ssa->cfg.blocks[n].children;
if (j >= 0) {
/* Push backtrack state */
zend_worklist_stack_push(&work, -(n + 1));
/* Push children in enter state */
unsigned int child_count = 0;
int len_prior = work.len;
do {
zend_worklist_stack_push(&work, j + 1);
j = ssa->cfg.blocks[j].next_child;
child_count++;
} while (j >= 0);
/* Reverse block order to maintain SSA variable number order given in previous PHP versions,
* but the data structure doesn't allow reverse dominator tree traversal. */
for (unsigned int i = 0; i < child_count / 2; i++) {
int tmp = work.buf[len_prior + i];
work.buf[len_prior + i] = work.buf[work.len - 1 - i];
work.buf[work.len - 1 - i] = tmp;
}
} else {
/* Leafs jump directly to backtracking */
goto backtrack;
}
}
/* Leave state: backtrack */
else {
n = -n;
n--;
backtrack:;
if (ssa->cfg.blocks[n].next_child >= 0) {
efree(save_vars[save_vars_top]);
save_vars_top--;
}
}
}
if (tmp) {
free_alloca(tmp, use_heap);
}
free_alloca(save_vars, save_vars_use_heap);
ZEND_WORKLIST_STACK_FREE_ALLOCA(&work, work_use_heap);
return SUCCESS;
}
/* }}} */
ZEND_API zend_result zend_build_ssa(zend_arena **arena, const zend_script *script, const zend_op_array *op_array, uint32_t build_flags, zend_ssa *ssa) /* {{{ */
{

View file

@ -193,28 +193,21 @@ AS_VAR_IF([GCC], [yes],
dnl Check if compiler supports -Wno-clobbered (only GCC).
AX_CHECK_COMPILE_FLAG([-Wno-clobbered],
[CFLAGS="-Wno-clobbered $CFLAGS"],,
[-Werror])
[CFLAGS="-Wno-clobbered $CFLAGS"])
dnl Check for support for implicit fallthrough level 1, also add after previous
dnl CFLAGS as level 3 is enabled in -Wextra.
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough=1],
[CFLAGS="$CFLAGS -Wimplicit-fallthrough=1"],,
[-Werror])
[CFLAGS="$CFLAGS -Wimplicit-fallthrough=1"])
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],
[CFLAGS="-Wduplicated-cond $CFLAGS"],,
[-Werror])
[CFLAGS="-Wduplicated-cond $CFLAGS"])
AX_CHECK_COMPILE_FLAG([-Wlogical-op],
[CFLAGS="-Wlogical-op $CFLAGS"],,
[-Werror])
[CFLAGS="-Wlogical-op $CFLAGS"])
AX_CHECK_COMPILE_FLAG([-Wformat-truncation],
[CFLAGS="-Wformat-truncation $CFLAGS"],,
[-Werror])
[CFLAGS="-Wformat-truncation $CFLAGS"])
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes],
[CFLAGS="-Wstrict-prototypes $CFLAGS"],,
[-Werror])
[CFLAGS="-Wstrict-prototypes $CFLAGS"])
AX_CHECK_COMPILE_FLAG([-fno-common],
[CFLAGS="-fno-common $CFLAGS"],,
[-Werror])
[CFLAGS="-fno-common $CFLAGS"])
ZEND_CHECK_ALIGNMENT
ZEND_CHECK_SIGNALS

View file

@ -1,3 +0,0 @@
<?php
/* dummy file for 014.phpt */
?>

View file

@ -0,0 +1,11 @@
--TEST--
GH-19303 (Unpacking empty packed array into uninitialized array causes assertion failure)
--FILE--
<?php
$a = [0];
unset($a[0]);
var_dump([...$a]);
?>
--EXPECT--
array(0) {
}

View file

@ -5,12 +5,12 @@ zend.assertions=1
assert.exception=1
--FILE--
<?php
var_dump((integer)ini_get("zend.assertions"));
var_dump((int)ini_get("zend.assertions"));
ini_set("zend.assertions", 0);
var_dump((integer)ini_get("zend.assertions"));
var_dump((int)ini_get("zend.assertions"));
assert(false);
ini_set("zend.assertions", 1);
var_dump((integer)ini_get("zend.assertions"));
var_dump((int)ini_get("zend.assertions"));
assert(true);
var_dump(true);
?>

View file

@ -0,0 +1,12 @@
--TEST--
#[Attribute] on an abstract class
--FILE--
<?php
#[Attribute]
abstract class Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to abstract class Demo in %s on line %d

View file

@ -0,0 +1,12 @@
--TEST--
#[Attribute] on an enum
--FILE--
<?php
#[Attribute]
enum Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to enum Demo in %s on line %d

View file

@ -0,0 +1,12 @@
--TEST--
#[Attribute] on an interface
--FILE--
<?php
#[Attribute]
interface Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to interface Demo in %s on line %d

View file

@ -0,0 +1,12 @@
--TEST--
#[Attribute] on a trait
--FILE--
<?php
#[Attribute]
trait Demo {}
echo "Done\n";
?>
--EXPECTF--
Fatal error: Cannot apply #[\Attribute] to trait Demo in %s on line %d

View file

@ -8,4 +8,4 @@ enum Test {}
?>
--EXPECTF--
Fatal error: Cannot apply #[AllowDynamicProperties] to enum Test in %s on line %d
Fatal error: Cannot apply #[\AllowDynamicProperties] to enum Test in %s on line %d

View file

@ -8,4 +8,4 @@ interface Test {}
?>
--EXPECTF--
Fatal error: Cannot apply #[AllowDynamicProperties] to interface Test in %s on line %d
Fatal error: Cannot apply #[\AllowDynamicProperties] to interface Test in %s on line %d

View file

@ -8,4 +8,4 @@ trait Test {}
?>
--EXPECTF--
Fatal error: Cannot apply #[AllowDynamicProperties] to trait Test in %s on line %d
Fatal error: Cannot apply #[\AllowDynamicProperties] to trait Test in %s on line %d

View file

@ -0,0 +1,39 @@
--TEST--
#[\Override]: Properties
--FILE--
<?php
interface I {
public mixed $i { get; }
}
interface II extends I {
#[\Override]
public mixed $i { get; }
}
class P {
public mixed $p1;
public mixed $p2;
}
class PP extends P {
#[\Override]
public mixed $p1;
public mixed $p2;
}
class C extends PP implements I {
#[\Override]
public mixed $i;
#[\Override]
public mixed $p1;
public mixed $p2;
public mixed $c;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,15 @@
--TEST--
#[\Override]: Properties: No parent class.
--FILE--
<?php
class C {
#[\Override]
public mixed $c;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,21 @@
--TEST--
#[\Override]: Properties: No parent class, but child implements matching interface.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
class P {
#[\Override]
public mixed $i;
}
class C extends P implements I {}
echo "Done";
?>
--EXPECTF--
Fatal error: P::$i has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,21 @@
--TEST--
#[\Override]: Properties: No parent class, but child implements matching interface (2).
--FILE--
<?php
interface I {
public mixed $i { get; }
}
class C extends P implements I {}
class P {
#[\Override]
public mixed $i;
}
echo "Done";
?>
--EXPECTF--
Fatal error: P::$i has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,26 @@
--TEST--
#[\Override]: Properties: No parent interface.
--FILE--
<?php
interface I {
#[\Override]
public mixed $i { get; }
}
interface II extends I {}
class C implements II {
public mixed $i;
}
class C2 implements I {
public mixed $i;
}
echo "Done";
?>
--EXPECTF--
Fatal error: I::$i has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,15 @@
--TEST--
#[\Override]: Properties: On trait.
--FILE--
<?php
trait T {
#[\Override]
public mixed $t;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,19 @@
--TEST--
#[\Override]: Properties: On used trait without parent property.
--FILE--
<?php
trait T {
#[\Override]
public mixed $t;
}
class Foo {
use T;
}
echo "Done";
?>
--EXPECTF--
Fatal error: Foo::$t has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,23 @@
--TEST--
#[\Override]: Properties: On used trait with interface property.
--FILE--
<?php
trait T {
#[\Override]
public mixed $i;
}
interface I {
public mixed $i { get; }
}
class Foo implements I {
use T;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,19 @@
--TEST--
#[\Override]: Properties: Parent property is private, child property is public.
--FILE--
<?php
class P {
private mixed $p;
}
class C extends P {
#[\Override]
public mixed $p;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$p has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,19 @@
--TEST--
#[\Override]: Properties: Parent property is private, child property is private.
--FILE--
<?php
class P {
private mixed $p;
}
class C extends P {
#[\Override]
private mixed $p;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$p has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,19 @@
--TEST--
#[\Override]: Properties: Parent property is protected, child property is public.
--FILE--
<?php
class P {
protected mixed $p;
}
class C extends P {
#[\Override]
public mixed $p;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,19 @@
--TEST--
#[\Override]: Properties: Parent property is protected, child property is protected.
--FILE--
<?php
class P {
protected mixed $p;
}
class C extends P {
#[\Override]
protected mixed $p;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,21 @@
--TEST--
#[\Override]: Properties: Redeclared trait property.
--FILE--
<?php
trait T {
public mixed $t;
}
class C {
use T;
#[\Override]
public mixed $t;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$t has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,25 @@
--TEST--
#[\Override]: Properties: Redeclared trait property with interface.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
trait T {
public mixed $i;
}
class C implements I {
use T;
#[\Override]
public mixed $i;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,19 @@
--TEST--
#[\Override]: Properties: Valid anonymous class.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
new class () implements I {
#[\Override]
public mixed $i;
};
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,21 @@
--TEST--
#[\Override]: Properties: Invalid anonymous class.
--FILE--
<?php
interface I {
public mixed $i { get; }
}
new class () implements I {
public mixed $i;
#[\Override]
public mixed $c;
};
echo "Done";
?>
--EXPECTF--
Fatal error: I@anonymous::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,16 @@
--TEST--
#[\Override]: Properties: Static property no parent class.
--FILE--
<?php
class C
{
#[\Override]
public static mixed $c;
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -0,0 +1,19 @@
--TEST--
#[\Override]: Properties: Static property.
--FILE--
<?php
class P {
public static mixed $p;
}
class C extends P {
#[\Override]
public static mixed $p;
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,21 @@
--TEST--
#[\Override]: Properties: valid promoted property
--FILE--
<?php
interface I {
public mixed $i { get; }
}
class C implements I {
public function __construct(
#[\Override]
public mixed $i,
) {}
}
echo "Done";
?>
--EXPECT--
Done

View file

@ -0,0 +1,17 @@
--TEST--
#[\Override]: Properties: invalid promoted property
--FILE--
<?php
class C {
public function __construct(
#[\Override]
public mixed $c,
) {}
}
echo "Done";
?>
--EXPECTF--
Fatal error: C::$c has #[\Override] attribute, but no matching parent property exists in %s on line %d

View file

@ -11,7 +11,6 @@ function boom()
$thing = new Thing();
xml_set_object($reader, $thing);
die("ok\n");
xml_parser_free($reader);
}
boom();
?>

View file

@ -8,7 +8,7 @@ if (extension_loaded("readline")) die("skip Test doesn't support readline");
<?php
$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
$cmd = "$php -n -d memory_limit=4M -a \"".__DIR__."\"/bug40236.inc";
echo `$cmd`;
echo shell_exec($cmd);
?>
--EXPECT--
Interactive shell (-a) requires the readline extension.

View file

@ -28,7 +28,7 @@ if (PHP_OS == 'Linux') {
}
}
elseif (PHP_OS == 'FreeBSD') {
$lines = explode("\n",`sysctl -a`);
$lines = explode("\n", shell_exec("sysctl -a"));
$infos = array();
foreach ($lines as $line) {
if (!$line){

View file

@ -17,5 +17,12 @@ function show_outputa($prepend, $output) {
show_outputa('Files: ', `cd .`); // this works as expected
?>
--EXPECT--
--EXPECTF--
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
Deprecated: The backtick (`) operator is deprecated, use shell_exec() instead in %s on line %d
Okey

View file

@ -1,7 +1,5 @@
--TEST--
Bug #67368 (Memory leak with immediately dereferenced array in class constant)
--INI--
report_memleaks=1
--FILE--
<?php
class FooBar {

View file

@ -1,16 +0,0 @@
--TEST--
Bug #79668 (get_defined_functions(true) may miss functions)
--INI--
disable_functions=sha1_file,password_hash
--FILE--
<?php
$df = get_defined_functions(true);
foreach (['sha1', 'sha1_file', 'hash', 'password_hash'] as $funcname) {
var_dump(in_array($funcname, $df['internal'], true));
}
?>
--EXPECT--
bool(true)
bool(false)
bool(true)
bool(false)

View file

@ -2,7 +2,6 @@
Bug #81104: Warning: "Failed to set memory limit to ... bytes" emitted after exit in debug
--INI--
memory_limit=5M
report_memleaks=0
--FILE--
<?php
#[AllowDynamicProperties]

View file

@ -0,0 +1,5 @@
<?php
var_dump(__COMPILER_HALT_OFFSET__);
__halt_compiler();

View file

@ -0,0 +1,12 @@
--TEST--
GH-18850: Repeated inclusion of file with __halt_compiler() triggers "Constant already defined" warning
--FILE--
<?php
require __DIR__ . '/gh18850.inc';
require __DIR__ . '/gh18850.inc';
?>
--EXPECT--
int(62)
int(62)

View file

@ -36,5 +36,7 @@ object(Foo)#%d (3) {
["c":"Foo":private]=>
int(3)
}
Deprecated: Returning null from Bar::__debugInfo() is deprecated, return an empty array instead in %s on line %d
object(Bar)#%d (0) {
}

View file

@ -0,0 +1,31 @@
--TEST--
Testing __debugInfo() magic method
--FILE--
<?php
set_error_handler(
static function () {
echo "in handler\n";
$f = new Foo();
var_dump($f);
}
);
class Foo {
public function __debugInfo() {
return null;
}
}
$f = new Foo;
var_dump($f);
?>
--EXPECTF--
in handler
Deprecated: Returning null from Foo::__debugInfo() is deprecated, return an empty array instead in %s on line %d
object(Foo)#3 (0) {
}
object(Foo)#2 (0) {
}

View file

@ -16,8 +16,8 @@ $storage[Foo::Baz] = 'Baz';
var_dump($storage[Foo::Bar]);
var_dump($storage[Foo::Baz]);
var_dump($storage->contains(Foo::Bar));
var_dump($storage->contains(Foo::Qux));
var_dump($storage->offsetExists(Foo::Bar));
var_dump($storage->offsetExists(Foo::Qux));
$serialized = serialize($storage);
var_dump($serialized);

View file

@ -3,8 +3,6 @@ Bug #26698 (Thrown exceptions while evaluating argument to pass as parameter cra
--FILE--
<?php
ini_set("report_memleaks", 0); // the exception thrown in this test results in a memory leak, which is fine
class ObjectOne
{
function getNone()

View file

@ -104,7 +104,7 @@ int(10)
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
int(1)
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
Exception: Too few arguments to function test2(), 0 passed in %s002.php on line %d and exactly 1 expected
Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
int(1)
int(2)
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function

View file

@ -59,7 +59,7 @@ array(1) {
[0]=>
int(1)
}
Exception: Too few arguments to function test2(), 0 passed in %s003.php on line %d and exactly 1 expected
Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected
array(2) {
[0]=>
int(1)
@ -68,7 +68,7 @@ array(2) {
}
array(0) {
}
Exception: Too few arguments to function test3(), 1 passed in %s003.php on line %d and exactly 2 expected
Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
array(2) {
[0]=>
int(1)

View file

@ -20,5 +20,6 @@ $action->filter();
$action->filter();
?>
DONE
--EXPECT--
--EXPECTF--
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
DONE

View file

@ -0,0 +1,3 @@
<?php
/* dummy file for get_included_files_basic.phpt */
?>

View file

@ -5,13 +5,13 @@ get_included_files() tests
var_dump(get_included_files());
include(__DIR__."/014.inc");
include(__DIR__."/get_included_files_basic.inc");
var_dump(get_included_files());
include_once(__DIR__."/014.inc");
include_once(__DIR__."/get_included_files_basic.inc");
var_dump(get_included_files());
include(__DIR__."/014.inc");
include(__DIR__."/get_included_files_basic.inc");
var_dump(get_included_files());
echo "Done\n";

24
Zend/tests/gh18736.phpt Normal file
View file

@ -0,0 +1,24 @@
--TEST--
GH-18736: Circumvented type check with return by ref + finally
--FILE--
<?php
function &test(): int {
$x = 0;
try {
return $x;
} finally {
$x = 'test';
}
}
try {
$x = &test();
var_dump($x);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
test(): Return value must be of type int, string returned

81
Zend/tests/gh19280.phpt Normal file
View file

@ -0,0 +1,81 @@
--TEST--
GH-19280: Stale nInternalPosition on rehashing
--FILE--
<?php
function rehash_packed() {
$a = range(0, 63);
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 16; $i < 62; $i++) {
unset($a[$i]);
}
var_dump(key($a));
$a[64] = 64;
var_dump(key($a));
}
function rehash_packed_iterated() {
$a = range(0, 63);
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 16; $i < 62; $i++) {
unset($a[$i]);
}
var_dump(key($a));
foreach ($a as &$_) {
$a[64] = 64;
break;
}
var_dump(key($a));
}
function rehash_string() {
$a = [];
for ($i = 0; $i < 64; $i++) {
$a[md5($i)] = $i;
}
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 16; $i < 62; $i++) {
unset($a[md5($i)]);
}
var_dump(key($a));
$a[md5(64)] = 64;
var_dump(key($a));
}
function rehash_int() {
$a = [];
for ($i = 63; $i >= 0; $i--) {
$a[$i] = $i;
}
for ($i = 0; $i <= 47; $i++) {
next($a);
}
for ($i = 48; $i >= 2; $i--) {
unset($a[$i]);
}
var_dump(key($a));
$a[64] = 64;
var_dump(key($a));
}
rehash_packed();
rehash_packed_iterated();
rehash_string();
rehash_int();
?>
--EXPECT--
int(62)
int(62)
int(62)
int(62)
string(32) "44f683a84163b3523afe57c2e008bc8c"
string(32) "44f683a84163b3523afe57c2e008bc8c"
int(1)
int(1)

18
Zend/tests/gh19304.phpt Normal file
View file

@ -0,0 +1,18 @@
--TEST--
GH-19304: Incorrect anonymous class type name assertion
--FILE--
<?php
$foo = new class {
public self $v;
};
try {
$foo->v = 0;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot assign int to property class@anonymous::$v of type class@anonymous

40
Zend/tests/gh19306.phpt Normal file
View file

@ -0,0 +1,40 @@
--TEST--
GH-19306: Generator suspended in yield from may be resumed
--FILE--
<?php
class It implements IteratorAggregate
{
public function getIterator(): Generator
{
yield "";
Fiber::suspend();
}
}
function g()
{
yield from new It();
}
$a = g();
$fiber = new Fiber(function () use ($a) {
echo "Fiber start\n";
$a->next();
echo "Fiber return\n";
});
$fiber->start();
echo "Fiber suspended\n";
try {
$a->next();
} catch (Throwable $t) {
echo $t->getMessage(), "\n";
}
echo "Destroying fiber\n";
$fiber = null;
echo "Shutdown\n";
?>
--EXPECT--
Fiber start
Fiber suspended
Cannot resume an already running generator
Destroying fiber
Shutdown

36
Zend/tests/gh19326.phpt Normal file
View file

@ -0,0 +1,36 @@
--TEST--
GH-19326: Calling Generator::throw() on a running generator with a non-Generator delegate crashes
--FILE--
<?php
class It implements IteratorAggregate {
public function getIterator(): Generator {
yield "";
Fiber::suspend();
}
}
function g() {
yield from new It();
}
$b = g();
$b->rewind();
$fiber = new Fiber(function () use ($b) {
$b->next();
});
$fiber->start();
try {
$b->throw(new Exception('test'));
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$fiber->resume();
?>
--EXPECT--
Cannot resume an already running generator

View file

@ -227,7 +227,7 @@ getValue(): NULL
setRawValueWithoutLazyInitialization():
getValue(): string(5) "value"
## Property [ public $hooked = NULL ]
## Property [ public $hooked = NULL { get; set; } ]
skipInitializerForProperty():
getValue(): NULL
@ -235,7 +235,7 @@ getValue(): NULL
setRawValueWithoutLazyInitialization():
getValue(): string(5) "value"
## Property [ public $virtual ]
## Property [ public virtual $virtual { get; set; } ]
skipInitializerForProperty():
ReflectionException: Can not use skipLazyInitialization on virtual property A::$virtual
@ -324,7 +324,7 @@ getValue(): NULL
setRawValueWithoutLazyInitialization():
getValue(): string(5) "value"
## Property [ public $hooked = NULL ]
## Property [ public $hooked = NULL { get; set; } ]
skipInitializerForProperty():
getValue(): NULL
@ -332,7 +332,7 @@ getValue(): NULL
setRawValueWithoutLazyInitialization():
getValue(): string(5) "value"
## Property [ public $virtual ]
## Property [ public virtual $virtual { get; set; } ]
skipInitializerForProperty():
ReflectionException: Can not use skipLazyInitialization on virtual property A::$virtual

View file

@ -5,7 +5,7 @@ precision=14
--FILE--
<?php
$doubles = array(
$floats = array(
076545676543223,
032325463734,
0777777,
@ -13,8 +13,8 @@ $doubles = array(
033333333333333,
);
foreach ($doubles as $d) {
$l = (double)$d;
foreach ($floats as $d) {
$l = (float)$d;
var_dump($l);
}

View file

@ -0,0 +1,26 @@
--TEST--
Fix GH-19476: Pipe operator with function returning by reference
--FILE--
<?php
function &get_ref($_): string {
static $a = "original";
$a .= " ".$_;
return $a;
}
function &test_pipe_ref(): string {
return "input" |> get_ref(...);
}
$ref = &test_pipe_ref();
echo "Before: " . $ref . "\n";
$ref = "changed";
echo "After: " . test_pipe_ref() . "\n";
?>
--EXPECT--
Before: original input
After: changed input

View file

@ -24,11 +24,13 @@ var_dump($r->hasDefaultValue());
var_dump($r->getDefaultValue());
?>
--EXPECT--
--EXPECTF--
Pre-test
Setting
Constructor
Getting
Setting
bool(false)
Deprecated: ReflectionProperty::getDefaultValue() for a property without a default value is deprecated, use ReflectionProperty::hasDefaultValue() to check if the default value exists in %s on line %d
NULL

View file

@ -12,4 +12,4 @@ $readonly_anon = new #[AllowDynamicProperties] readonly class {
?>
--EXPECTF--
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class class@anonymous in %s on line %d
Fatal error: Cannot apply #[\AllowDynamicProperties] to readonly class class@anonymous in %s on line %d

View file

@ -10,4 +10,4 @@ readonly class Foo
?>
--EXPECTF--
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class Foo in %s on line %d
Fatal error: Cannot apply #[\AllowDynamicProperties] to readonly class Foo in %s on line %d

Some files were not shown because too many files have changed in this diff Show more