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

6649 Commits

Author SHA1 Message Date
Ilija Tovilo
073dcf66bb Merge branch 'PHP-8.5'
* PHP-8.5:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:28 +01:00
Ilija Tovilo
07e29acbd4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:21 +01:00
Ilija Tovilo
6f91209260 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:14 +01:00
Ilija Tovilo
c6ad84fb9e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:04:24 +01:00
Ilija Tovilo
3a57b4ced5 Add RUN_RESOURCE_HEAVY_TESTS env var
Disable resource-heavy tests by default (>1GB of memory usage), unless the
RUN_RESOURCE_HEAVY_TESTS env variable is set.

Fixes GH-20762
Closes GH-20935
2026-02-27 15:00:35 +01:00
Peter Kokot
7158e6376e Merge branch 'PHP-8.5'
* PHP-8.5:
  sapi/*/Makefile.frag: install programs built with libtool, with libtool
2026-02-23 17:21:24 +01:00
Peter Kokot
c89b363fc9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  sapi/*/Makefile.frag: install programs built with libtool, with libtool
2026-02-23 17:20:59 +01:00
Michael Orlitzky
db6cca26dd sapi/*/Makefile.frag: install programs built with libtool, with libtool
When installing executables that were built using libtool, we are
supposed to use

  $ libtool --mode-install <install-command>

rather than the bare <install-command>. This is discussed ever so
briefly in the "Installing executables" section of the GNU libtool
documentation:

  https://www.gnu.org/software/libtool/manual/libtool.html

So far this has not caused a problem with GNU libtool on the platforms
that PHP supports, but there is an alternate libtool implementation
called slibtool that stores wrappers at the locations where PHP is
expecting the true executables to live. As a result, the wrappers (and
not the executables) are installed when slibtool is used to build PHP.

This is fixed by replacing,

  $(INSTALL)

with

  $(LIBTOOL) --mode=install $(INSTALL)

in the install-foo rules for the executables that are built with
libtool.

Closes GH-13674
2026-02-23 17:19:23 +01:00
Ilija Tovilo
6173a9a109 VAR|TMP overhaul (GH-20628)
The aim of this PR is twofold:

- Reduce the number of highly similar TMP|VAR handlers
- Avoid ZVAL_DEREF in most of these cases

This is achieved by guaranteeing that all zend_compile_expr() calls, as well as
all other compile calls with BP_VAR_{R,IS}, will result in a TMP variable. This
implies that the result will not contain an IS_INDIRECT or IS_REFERENCE value,
which was mostly already the case, with two exceptions:

- Calls to return-by-reference functions. Because return-by-reference functions
  are quite rare, this is solved by delegating the DEREF to the RETURN_BY_REF
  handler, which will examine the stack to check whether the caller expects a
  VAR or TMP to understand whether the DEREF is needed. Internal functions will
  also need to adjust by calling the zend_return_unwrap_ref() function.

- By-reference assignments, including both $a = &$b, as well as $a = [&$b]. When
  the result of these expressions is used in a BP_VAR_R context, the reference
  is unwrapped via a ZEND_QM_ASSIGN opcode beforehand. This is exceptionally
  rare.

Closes GH-20628
2026-01-31 19:44:56 +01:00
Khaled Alam
d03d69a88a Remove duplicate #include statements (#21085)
* Remove duplicate #include statements across the codebase.

* feat: Restore conditional/unconditional include pairs in lscriu.c
2026-01-30 16:37:13 +01:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Ilija Tovilo
eb1d45bd42 Restore opcache_invalidate() fuzzer behavior
The zend_exception_save() and zend_exception_restore() functions were removed in
GH-20256. However, the fuzzer expects to be able to call opcache_invalidate()
even if there was an exception thrown. I'm not sure why exactly, but let's
restore the previous behavior.

Closes OSS-Fuzz #476466130
2026-01-20 15:53:08 +01:00
Ilija Tovilo
084e409694 Remove zend_exception_save() and zend_exception_restore()
These are leftovers from the pre-PHP-7.0 era. This also implicitly solves
GH-20564 by not clearing exceptions before entering the autoloader.

Closes GH-20256
Fixes GH-20564
2026-01-16 20:18:51 +01:00
Weilin Du
4f793ba1c3 [skip ci] Fix duplicate words typos (GH-20800) 2025-12-31 02:22:09 +01:00
Arnaud Le Blanc
626f3c3c7c Unify arg info representation for internal and user functions
The arg_info member of zend_function is now always a zend_arg_info*. Before,
it was a zend_internal_arg_info* on internal functions, unless the
ZEND_ACC_USER_ARG_INFO flag was set.

Closes GH-19022
2025-12-15 16:50:49 +01:00
Niels Dossche
4d28e2af9e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  sapi/fpm: remove use of variable-length arrays (#10645)
2025-12-14 23:30:54 +01:00
Max Kellermann
5850c7de7c sapi/fpm: remove use of variable-length arrays (#10645)
According to @cmb69, PHP does not require VLA support
(https://github.com/php/php-src/pull/10304#discussion_r1069343092).
VLAs are a bad idea for several reasons, so let's get rid of them.

Two of the VLAs were probably unintended; unlike C++, C doesn't have
the concept of "constant expressions", so an array with a "const"
length is technically still a VLA.  This is fixed by removing the
"const" variable, and using sizeof() instead.

(cherry picked from commit ff2a211d55)
2025-12-14 23:30:37 +01:00
Niels Dossche
c27368c939 cli: Use zend_hash_str_find_ptr_lc() in get_mime_type() 2025-12-10 11:13:39 -08:00
René Schleusner
26e0bfa341 Fixed some typos in docs and fpm pool config (GH-20587)
* Fix some typos in docs

* Fix typo in output header example of fpm pool config
2025-12-05 20:20:40 +01:00
David Carlier
509cb06dc2 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20554: php_cli_server() get http status as string build issue.
2025-11-22 22:26:10 +00:00
David Carlier
5562e5558a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20554: php_cli_server() get http status as string build issue.
2025-11-22 22:26:01 +00:00
David Carlier
30fbcf9d7e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20554: php_cli_server() get http status as string build issue.
2025-11-22 22:25:51 +00:00
David Carlier
9149c35514 Fix GH-20554: php_cli_server() get http status as string build issue.
due to the signature of this helper it needs to be const also
bsearch key argument needs to be too.

close GH-20556
2025-11-22 22:25:33 +00:00
Gina Peter Banyard
0c97fe082f Merge branch 'PHP-8.5'
* PHP-8.5:
  sapi/phpdbg: use 'h' ZPP specifier instead of'H'
2025-11-13 01:34:03 +00:00
Gina Peter Banyard
e1c8ed614e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  sapi/phpdbg: use 'h' ZPP specifier instead of'H'
2025-11-13 01:32:14 +00:00
Gina Peter Banyard
a7fd6fc8d6 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  sapi/phpdbg: use 'h' ZPP specifier instead of'H'
2025-11-13 01:31:42 +00:00
Gina Peter Banyard
37e61a0dc0 sapi/phpdbg: fixed ZPP type violation by using 'h' ZPP specifier instead of 'H'
This aligns the behaviour with what the stubs say.
And even if one fixes the stubs the behaviour is not identical due to missing indirect handling.

This indicates that using objects is never done, so do the easy fix of changing the ZPP specifier.

Closes GH-20465
2025-11-13 01:30:49 +00:00
Gina Peter Banyard
414e7db68a sapi/phpdbg: use 'h' ZPP specifier instead of'H'
The stubs say array so in debug mode we get a ZPP violation assertion and even by fixing the stubs the behaviour is not identical due to missing indirect handling.

This indicates using objects was never done, thus use the correct ZPP specifier
2025-11-12 16:01:43 +00:00
Ilija Tovilo
51edaac9cf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Skip fpm tests crashing lsan on GHA
2025-11-05 13:23:09 +01:00
Ilija Tovilo
b9eaee18e4 [skip ci] Skip fpm tests crashing lsan on GHA
> LeakSanitizer has encountered a fatal error.

This happens only on 8.2/8.3 for some reason. Don't merge for 8.4 for now, we
can do that later if it reoccurs.
2025-11-05 13:22:44 +01:00
Ilija Tovilo
a7fde28d90 Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Fix typo
2025-10-17 13:22:57 +02:00
Ilija Tovilo
f67f79cbcd Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Fix typo
2025-10-17 13:22:51 +02:00
Ilija Tovilo
5a427cee98 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Fix typo
2025-10-17 13:22:44 +02:00
Ilija Tovilo
5fd73b55a7 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Fix typo
2025-10-17 13:22:37 +02:00
Ilija Tovilo
413c73153d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Fix typo
2025-10-17 13:22:32 +02:00
Ilija Tovilo
d62f70c6de [skip ci] Fix typo
Should've been skip, not flaky...
2025-10-17 13:21:49 +02:00
Ilija Tovilo
abcf0c4418 Merge branch 'PHP-8.5'
* PHP-8.5:
  [skip ci] Skip suspicious fpm tests on GH actions & macOS
2025-10-17 13:17:55 +02:00
Ilija Tovilo
00bec81c1c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [skip ci] Skip suspicious fpm tests on GH actions & macOS
2025-10-17 13:17:48 +02:00
Ilija Tovilo
2fe20a075f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Skip suspicious fpm tests on GH actions & macOS
2025-10-17 13:17:41 +02:00
Ilija Tovilo
75099da105 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Skip suspicious fpm tests on GH actions & macOS
2025-10-17 13:17:33 +02:00
Ilija Tovilo
2b0763148d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Skip suspicious fpm tests on GH actions & macOS
2025-10-17 13:17:25 +02:00
Ilija Tovilo
b094d5a588 [skip ci] Skip suspicious fpm tests on GH actions & macOS
There have been misterious macOS failures with the following error for a long
time, which would usually happen 1-2x per nightly run:

> The hosted runner lost communication with the server. Anything in your
> workflow that terminates the runner process, starves it for CPU/Memory, or
> blocks its network access can cause this error.

After way too much debugging, it looks like this is caused by the two fpm tests
skipped in this commit. When there's a failure, the responsible test will run
for at least 120 seconds until the job is eventually killed by GitHub Actions.
It's not clear yet why the tests stall.

Debugging this is a PITA because the GitHub Actions log gets partially lost for
killed jobs. It took an external log server to actually figure out where the job
fails. Let's disable the tests first to be sure this actually solves the issue.
2025-10-17 13:04:11 +02:00
Jakub Zelenka
12b16c6c93 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-19989: PHP 8.5 FPM access log lines also go to STDERR
2025-10-10 17:19:52 +02:00
Jakub Zelenka
234577ee90 Fix GH-19989: PHP 8.5 FPM access log lines also go to STDERR
This was due to not omitting logging using external_log

Closes GH-20123
2025-10-10 17:18:47 +02:00
Jakub Zelenka
02e38fe22e Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-19974: fpm_status_export_to_zval segfault for parallel execution
2025-10-09 21:35:37 +02:00
Jakub Zelenka
1570ce9f55 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-19974: fpm_status_export_to_zval segfault for parallel execution
2025-10-09 21:35:07 +02:00
Jakub Zelenka
da7558ab4e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19974: fpm_status_export_to_zval segfault for parallel execution
2025-10-09 21:34:14 +02:00
Jakub Zelenka
059f9f78e5 Fix GH-19974: fpm_status_export_to_zval segfault for parallel execution
The fix fixes some other races that could result in mixed up copy and
nprocs number. It requires creating a copy in a similar way like for
request status.

This was not previously used to not impact other requests. However this
does not make that much sense as the only thing that impacts it is
holding the lock and not waiting for it. It is true that if there was a
big contention then the lock would be acquired more often but that can
be achieved by using fpm_get_status in loop so it should not make a
huge difference hopefully.

Closes GH-19974
2025-10-09 21:32:04 +02:00
Jakub Zelenka
b889ec41c1 Merge branch 'PHP-8.5'
* PHP-8.5:
  Add missing NEWS entry for FPM GH-19817 fix
  Fix GH-19817: Decode SCRIPT_FILENAME issue in php 8.5 (#20114)
2025-10-09 14:13:31 +02:00
Jakub Zelenka
74674c3d56 Fix GH-19817: Decode SCRIPT_FILENAME issue in php 8.5 (#20114)
This changes default for fastcgi.script_path_encoded INI to have
default behavior without a BC break. There has been already issue
about this in RC so it is very likely that it could have much bigger
impact so it's better to be safe.
2025-10-09 14:10:14 +02:00