1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

142258 Commits

Author SHA1 Message Date
Daniel Scherzer
ae73654909 Update versions for PHP 8.5.0alpha3 php-8.5.0alpha3 2025-07-29 13:52:18 -07:00
David CARLIER
abee5c138f ext/intl: convert C part to C++ step 1. (#19231) 2025-07-29 20:22:19 +01:00
Bogdan Ungureanu
e8b5bcfe19 Intl: IntlListFormatter - update exception message (#19282) 2025-07-29 08:35:27 -07:00
Niels Dossche
4c576a2b02 Fix exception handling in shm_put_var() (#19279) 2025-07-29 17:31:06 +02:00
Daniel Scherzer
ec0ec47bbf NEWS: move a misplaced comma [skip ci] 2025-07-29 08:13:33 -07:00
Daniel Scherzer
61415942c2 ext/standard: drop old smart_string headers (#19233)
Functionality was removed in PHP 7.2
2025-07-29 07:57:19 -07:00
Daniel Scherzer
d23e4ba538 UPGRADING.INTERNALS: document ZEND_DECLARE_ATTRIBUTED_CONST (#19270)
[skip ci]
2025-07-29 07:55:39 -07:00
Daniel Scherzer
54863f4930 gen_stub: Update PHP-Parser to 5.6.0 (#19271)
Includes support for declaring functions named `clone`, so update the stub file
where `clone` is declared to remove the `_clone` workaround.
2025-07-29 07:47:58 -07:00
Arnaud Le Blanc
712508fdb2 Call php_child_init() after fork during preloading (#19287) 2025-07-29 16:10:35 +02:00
Jakub Zelenka
ce6e7a2786 Integrate OpenSSL libctx to pwhash (#19236)
This allows using OpenSSL Argon2 password hashing on ZTS.

Closes GH-19236
2025-07-29 15:06:34 +02:00
David Carlier
f72105be81 ext/posix: value ranges check for posix_setrlimit and posix_setpgid
setpgid accepts values from 0 to "PID_MAX".
for setrlimit the culprit is using zend_long to represent rlim_t
but at least we accept -1 for RLIM_INFINITY, however rl_cur should
not be greater than rl_max value.

close GH-19281
2025-07-29 13:10:26 +01:00
Arnaud Le Blanc
c561f7da85 Refresh zend_mm shadow key on fork
The shadow key is refreshed when resetting the memory manager between two
requests. But in forking SAPIs the first request of a child process inherits the
shadow key of the parent. As a result, a leak of the shadow key during the first
request of one process gives away the shadow key used during the first request
of other processes. This makes the key refresh mechanism less useful.

Here I ensure that we refresh the shadow key after a fork. We can not reset the
manager as there may be active allocations. Instead, we have to recompute shadow
pointers with the new key.

Closes GH-16765
2025-07-29 14:00:37 +02:00
Arnaud Le Blanc
8e38f6d1c6 Fix out of tree builds (#19283) 2025-07-29 13:36:30 +02:00
Jakub Zelenka
cecf9b02e5 Remove unused FPM_LOG_BUFFER 2025-07-29 11:43:57 +02:00
Jakub Zelenka
cfb3e98c84 FPM: Implement configurable access log limit
It sets the access log limit as configurable log_limit to allow larger
log limit than the currently fixed limit of 1024 characters.

Fixes GH-12302
Closes GH-18725
2025-07-29 11:32:01 +02:00
Ilija Tovilo
35a4656a59 Fix error recording with file cache only (GH-19278)
Introduced by GH-18541.

This path is hit when compilation fails with a compile error, rather than
bailout. If a non-fatal error is recorded, it will not be emitted nor freed.
Handle accordingly.
2025-07-29 10:06:43 +02:00
Máté Kocsis
e48099a03c Update real-time benchmark config after opcache became mandatory
https://wiki.php.net/rfc/make_opcache_required removed the --enable-opcache option, and this change creates a problem for the benchmark: the master branch (containing the RFC implementation) cannot use the deprecated options and config anymore, while earlier versions must still use them.

Therefore, the benchmark had to introduce the PHP_OPCACHE=2 config value (3455b34856) to signal that opcache still has to be manually enabled. After the next benchmark run,  PHP_OPCACHE for the previous PHP version has to be switched back to "1".

[skip-ci]
2025-07-29 00:16:37 +02:00
Gina Peter Banyard
b30ccf9158 Merge branch 'PHP-8.4'
* PHP-8.4:
  ext/intl: Fix return value on failure for resourcebundle count handler
2025-07-28 15:36:44 +01:00
Gina Peter Banyard
5295fc07d5 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/intl: Fix return value on failure for resourcebundle count handler
2025-07-28 15:36:02 +01:00
Gina Peter Banyard
6b0a80903b ext/intl: Fix return value on failure for resourcebundle count handler
Closes GH-19277
2025-07-28 15:35:31 +01:00
Gina Peter Banyard
f63a35d944 ext/sysvmsg: various minor refactorings 2025-07-28 15:33:22 +01:00
Gina Peter Banyard
87d83d162d ext/sysvsem: use bool type instead of int 2025-07-28 15:33:22 +01:00
Gina Peter Banyard
bac158c80d ext/sysvshm: use size_t and ssize_t instead of zend_long 2025-07-28 15:33:22 +01:00
Gina Peter Banyard
6154fac64d ext/sysvshm: refactor php_put_shm_data() 2025-07-28 15:33:22 +01:00
Gina Peter Banyard
4844c7a92f ext/sysvshm: voidify php_remove_shm_data() 2025-07-28 15:33:22 +01:00
Gina Peter Banyard
e897621be9 ext/sysvshm: shm_detach() always returns true 2025-07-28 15:33:22 +01:00
David Carlier
3b4f2b0798 ext/posix: posix_kill() process_id range check.
pid_t is, for the most part, represented by a signed int, by overflowing
it, we end up being in the -1 case which affect all accessible processes.

close GH-18944
2025-07-28 15:31:14 +01:00
Gina Peter Banyard
eaf24ba4e2 Merge branch 'PHP-8.4'
* PHP-8.4:
  ext/gd: Fix comparison with result of php_stream_can_cast()
2025-07-28 11:55:43 +01:00
Gina Peter Banyard
19c84e2687 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/gd: Fix comparison with result of php_stream_can_cast()
2025-07-28 11:55:14 +01:00
Gina Peter Banyard
83b8d2c290 ext/gd: Fix comparison with result of php_stream_can_cast()
Closes GH-19107
2025-07-28 11:54:19 +01:00
Gina Peter Banyard
b75c2dcb02 Remove myself from bcmath codeowner
I haven't kept up with the extension nor been doing proper reviews for it
2025-07-28 11:22:22 +01:00
Dmitrii Derepko
5947fedbbd ext/standard: handle html entities empty string before processing (#19220) 2025-07-28 12:15:26 +02:00
Daniel Scherzer
ff810d5e36 Arginfo: reuse zend_string objects for initializing attribute values (#19241)
Avoid initializing the same string content multiple times and make use of the
fact that the strings created to initialize attribute values are not freed by
simply making use of an existing zend_string with the same content if one is
available.
2025-07-27 17:27:22 -07:00
David CARLIER
068aaed196 ext/sockets: using accept4 wheneever possible for php_accept_connect helper (#19268)
Haiku now supports it as well now, so we can simplify the workflow a bit for those platforms.
2025-07-27 20:52:11 +01:00
Gina Peter Banyard
191290e194 ext/intl: Split error tests out and stop relying on ut_common() testing (#19266) 2025-07-27 19:40:42 +01:00
David CARLIER
4a0ad9bd91 ext/sockets: cmsg data array elements using uint32_t type instead. (#19254) 2025-07-27 15:43:59 +01:00
Niels Dossche
63e40b1b29 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix bug #51558: shared readline build fails (#15242)
2025-07-27 15:34:30 +02:00
Niels Dossche
3da9478d78 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix bug #51558: shared readline build fails (#15242)
2025-07-27 15:34:23 +02:00
Peter Kokot
17df11e3f7 Fix bug #51558: shared readline build fails (#15242)
The 'rl_pending_input' is a variable in Readline library and checking it
with PHP_CHECK_LIBRARY wouldn't find it on some systems.

Library check works on most systems but not on the mentioned AIX in the
bug as it exports variables and functions differently whereas the linker
couldn't resolve the variable as a function.

This should fix the build on systems where this caused issues, such as
AIX.

The <readline/readline.h> is not self-contained header and needs to also
have <stdio.h> included before to have FILE type available. This fixes
the issue on unpatched default readline installations, such as macOS.

Checking this variable ensures that the found library is the correct
library and also that it is of minimum version needed by current PHP
code (https://bugs.php.net/48608).

The library check:

```c
| char rl_pending_input ();
| int main (void) {
|     return rl_pending_input ();
| }
```

The declaration check:

```c
| #include <stdio.h>
| #include <readline/readline.h>
| int main (void) {
| #ifndef rl_pending_input
| #ifdef __cplusplus
|     (void) rl_pending_input;
| #else
|     (void) rl_pending_input;
| #endif
| #endif
| ;
|     return 0;
| }
```

Closes https://bugs.php.net/51558

Closes GH-19259.
2025-07-27 15:33:48 +02:00
David Carlier
f4ad6ea287 Merge branch 'PHP-8.4' 2025-07-27 13:50:30 +01:00
David Carlier
87b4030503 Merge branch 'PHP-8.3' into PHP-8.4 2025-07-27 13:50:21 +01:00
David Carlier
e1c4a0ae51 Fixed GH-19261: msgfmt_parse_message leaks on message format failure.
close GH-19262
2025-07-27 13:49:24 +01:00
David Carlier
f7ca8138e7 Merge branch 'PHP-8.4' 2025-07-27 12:56:05 +01:00
David Carlier
279589c3af Merge branch 'PHP-8.3' into PHP-8.4 2025-07-27 12:55:17 +01:00
dixyes
e16df981bf ext/pdo_pgsql: Fix _pdo_pgsql_trim_message bad access
close GH-19239
2025-07-27 12:54:43 +01:00
Arnaud Le Blanc
7b3e68ff69 Fix error handling inconsistency with opcache
When opcache is enabled, error handling is altered in the following ways:

 * Errors emitted during compilation bypass the user-defined error handler
 * Exceptions emitted during class linking are turned into fatal errors

Changes here make the behavior consistent regardless of opcache being enabled or
not:

 * Errors emitted during compilation and class linking are always delayed and
   handled after compilation or class linking. During handling, user-defined
   error handlers are not bypassed. Fatal errors emitted during compilation or
   class linking cause any delayed errors to be handled immediately (without
   calling user-defined error handlers, as it would be unsafe).
 * Exceptions thrown by user-defined error handlers when handling class linking
   error are not promoted to fatal errors anymore and do not prevent linking.

Fixes GH-17422.
Closes GH-18541.
Closes GH-17627.

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2025-07-27 11:01:49 +02:00
Niels Dossche
9b777b3c35 Merge branch 'PHP-8.4'
* PHP-8.4:
  Free opened_path when opened_path_len >= MAXPATHLEN
2025-07-27 10:54:53 +02:00
Niels Dossche
1c74a1a889 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Free opened_path when opened_path_len >= MAXPATHLEN
2025-07-27 10:54:46 +02:00
dixyes
5dd965117a Free opened_path when opened_path_len >= MAXPATHLEN
Closes GH-19240.
2025-07-27 10:54:21 +02:00
Tim Düsterhus
d3ebf97d77 Fix expectations in version string tests 2025-07-27 09:40:23 +02:00