1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Commit Graph

142279 Commits

Author SHA1 Message Date
Daniel Scherzer
b1ba26ec10 Update versions for PHP 8.5.0alpha4 php-8.5.0alpha4 2025-07-30 13:49:23 -07:00
Daniel Scherzer
9999d66bce ext/standard/tests/file/bug81145.phpt: unlink file before exit (#19293)
If the test is skipped, the `--SKIPIF--` section exits (via `die()`) without
removing the "bug81145_src.bin" file that gets created, and because the test
was skipped the `--CLEAN--` section is not run, leaving the .bin file behind.

Adjust the `--SKIPIF--` section to remove the .bin file before exiting.
2025-07-30 13:14:10 -07:00
Christoph M. Becker
4754d302bf Fix #19307: PGO builds of shared ext-intl are broken
We resolve the name mangling issue by including the right header file
inside an `extern "C"` declaration.

Closes GH-19310.
2025-07-30 18:33:40 +02:00
Arnaud Le Blanc
8538e2fe6b Merge branch 'PHP-8.4'
* PHP-8.4:
  Prevent operands from being released during comparison
2025-07-30 18:14:45 +02:00
Arnaud Le Blanc
28ed4e6ec0 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Prevent operands from being released during comparison
2025-07-30 18:11:32 +02:00
Arnaud Le Blanc
bc4b6ce7a8 Prevent operands from being released during comparison
Fixes GH-19305
Closes GH-19309
2025-07-30 18:09:24 +02:00
Gina Peter Banyard
6600d0e00f ext/intl: Refactor error handling (#19196)
This is a comprehensive refactoring of the error mechanism of the Intl extension.

By moving the prefixing of the current method/function being executed to actual error message creation by accessing the execution context, we get the following benefits:
- Accurate error messages indicating *what* call caused the error
  - As we *always* "copy" the message, the `copyMsg` arg becomes unused, meaning we can reduce the size of the `intl_error` struct by 4 bytes.
  - Saving it as a zend_string means we know the length of the message
- Remove the need to pass around a "function name" `char*` across multiple calls
- Use Intl's exception mechanism to generate exceptions for constructor call
  - This removes the need for replacing the error handler
  - Which didn't do anything anyway in silent mode, which required throwing non-descriptive exceptions
2025-07-30 16:00:37 +01:00
Ilija Tovilo
03e2613ddd Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix failed assertion with throwing __toString in binary const expr
2025-07-30 13:34:43 +02:00
Ilija Tovilo
138ebf481b Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix failed assertion with throwing __toString in binary const expr
2025-07-30 13:34:32 +02:00
Ilija Tovilo
80022c035b Fix failed assertion with throwing __toString in binary const expr
Solve this with the same pattern as ZEND_AST_GREATER[_EQUAL].

Fixes OSS-Fuzz #434346548
Closes GH-19291
2025-07-30 13:34:01 +02:00
Gina Peter Banyard
7bac9de94a Zend: refactor zend_call_method_if_exists() API
The objective of this is to stop relying on the fci.function_name zval field,
to see if in the future we can get rid of said field and fit an FCI/FCC pair in a single cache line
2025-07-30 12:02:41 +01:00
Gina Peter Banyard
fc6c49cbf4 ext/zend_test: Test zend_call_method_if_exists() 2025-07-30 12:02:41 +01:00
Remi Collet
a9f3e3c44e Fix GH-19298 missing libraries for opcache
In the absence of `PHP_ARG_WITH([opcache],` the value of ext_shared is not
initialized while processing directives of ext/opcache/config.m4, causing
PHP_EVAL_LIBLINE() to add libs to OPCACHE_SHARED_LIBADD instead of LIBS.

Closes GH-19301
2025-07-30 11:15:45 +02:00
Niels Dossche
16b2fc41a3 Merge branch 'PHP-8.4'
* PHP-8.4:
  Reset global pointers to prevent use-after-free
2025-07-30 09:23:38 +02:00
Niels Dossche
6fda0a5617 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Reset global pointers to prevent use-after-free
2025-07-30 09:23:33 +02:00
Niels Dossche
be9f1d3d56 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Reset global pointers to prevent use-after-free
2025-07-30 09:23:12 +02:00
Niels Dossche
7016ad558b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Reset global pointers to prevent use-after-free
2025-07-30 09:22:50 +02:00
Florian Engelhardt
3aaa8d3526 Reset global pointers to prevent use-after-free
Closes GH-19212.
2025-07-30 09:22:15 +02:00
Niels Dossche
bc2d02e3a9 Fix fuzzer after opcache became mandatory (#19292) 2025-07-30 09:01:10 +02:00
Daniel Scherzer
c1b129bd18 [ci skip] Update NEWS for PHP 8.5.0 beta1 2025-07-29 13:59:19 -07:00
Gina Peter Banyard
a95a81000d Zend: Exception::__toString() no need to allocate the method name
We can create the FCI/FCC pair ourself outside of the loop as the method getTraceAsString is final

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2025-07-29 21:16:13 +01:00
Gina Peter Banyard
c9e91bfbab Zend/zend_exceptions: Add const modifiers 2025-07-29 21:16:13 +01: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