1509 Commits
Author SHA1 Message Date
Ilija Tovilo d6373dfe15 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:33:23 +02:00
Ilija Tovilo c7273b9ba8 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:30:04 +02:00
Ilija Tovilo 8a94bb3822 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:27:03 +02:00
Ilija Tovilo c1a5f468d0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:12:35 +02:00
3584a98bda Avoid state corruption via bailout
- Replace bailout on OOM with UnwindExit
- Properly reset various globals that may be accessed during startup

Fix GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
Fix GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Jakub Zelenka <bukka@php.net>
Co-authored-by: Nora Dossche <7771979+ndossche@users.noreply.github.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
2026-10-21 16:06:22 +02:00
Shivam Mathur bc9387737e Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Preserve bare NUL access with open_basedir on Windows (#24158)
2026-10-06 18:24:54 +05:30
Shivam Mathur 1b8f278df3 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Preserve bare NUL access with open_basedir on Windows (#24158)
2026-10-06 18:24:41 +05:30
Shivam Mathur bba11e690c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Preserve bare NUL access with open_basedir on Windows (#24158)
2026-10-06 18:24:22 +05:30
Shivam Mathur 6d7aa18f9c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Preserve bare NUL access with open_basedir on Windows (#24158)
2026-10-06 18:24:07 +05:30
Shivam Mathur 1b47a92963 Preserve bare NUL access with open_basedir on Windows (#24158) 2026-10-06 18:23:41 +05:30
Ilia Alshanetsky 934d4ff95f Pin $this in zend_call_function (#22151)
zend_call_function() ran the callback with fci_cache->object as $this
without holding a reference, so a callback that released the last
reference to its own receiver (an autoloader unregistering itself, a
SQLite3 authorizer calling setAuthorizer(null)) freed $this while its
frame was still executing. Take the reference where the receiver is
selected rather than after argument setup, so the error handlers
reachable from the deprecation notice and the by-reference warning
cannot free it first, and release it on every early exit.

Fixes GH-22060
Fixes GH-22122
2026-09-21 17:32:32 -04:00
NickSdot 1d2ea5ce22 Run tests in parallel by default (#22939)
Runs the test suite in parallel by default; automatically selects up to 10 workers. Explicit -j1 remains the opt-out to run tests serial. Smaller batches improve balancing.
2026-08-10 11:33:43 +02:00
NickSdot eaac14a17a tests: applied fixers to improve test robustness (#22988) 2026-08-06 17:31:33 +01:00
NickSdot 5d58876192 tests: Cache failed service probes (#22944)
Prevents unavailable optional test services from slowing the suite through repeated connection timeouts. PDO and SNMP availability probes cache the first failure for the duration of one test run, so later SKIPIF checks return immediately.

Only failures are cached; successful probes and test connections are unchanged. PDOs one second timeout applies only to the default availability probe. The caches are private, run-scoped and removed afterwards. A service becoming available mid run is detected on the next test-suite run.
2026-08-06 11:42:56 +02:00
NickSdot 7785159f7e Fix redirected-test progress accounting in parallel runs (#22952) 2026-08-03 18:22:06 +02:00
NickSdot 2b6075bddf run-tests: run test subprocesses without a shell where possible (#22957) 2026-08-03 18:17:27 +02:00
Gina Peter Banyard 1805822555 sapi: only use FCC for header_register_callback() (#22877)
No need to rederive callability of zval, or copies of it.
2026-07-26 12:42:35 +01:00
Jakub ZelenkaandDavid Carlier 32a0f3b6cf IO copy API for stream copying (#20399)
This introduces new API for fd copying and modifies
php_stream_copy_to_stream_ex to use it. The implementation is separated
for various platforms and the end result have couple of implications:

- sendfile is used for copying file to generic fd (e.g. sockets) on all
  platforms except Windows that use TransmitFile
- splice is used for copying between generic fds (e.g. sockets) on
  Linux
- copy_file_range should get used on alpine linux with directly using
  syscall (as musl does not seem to implement it)
- copy_file_range is used in the loop so it is used multiple times for
  files bigger than 2GB on Linux.
- file mmap for copying is removed as it allowed crashing PHP when
  another process modified mapped file - this was used as a fallback
  for file copying. Sendfile should partially replace it.
- File to file copying was optimized on Windows with use of ReadFile
  and WriteFile.

This also adds various tests including Linux unit tests.

Closes GH-20399

Co-authored-by: David Carlier <devnexen@gmail.com>
2026-07-19 17:15:16 +02:00
Gina Peter Banyard 34c686a5b4 stream: remove path parameter in stream error functions (#22792)
Instead rely on the mechanism gated by the error_include_args INI to display them.

This actually aligns the behaviour of what was accepted in https://wiki.php.net/rfc/display_error_function_args.
2026-07-19 16:15:01 +01:00
Gina Peter Banyard 1f7abed789 streams: remove php_stream_wrapper_warn_param() functions
And instead let the normal docref error handling code handle arguments
2026-07-17 14:33:38 +01:00
Ilia Alshanetsky 5ce795bec1 Fix GH-20964: fseek() on php://memory with PHP_INT_MIN causes undefined behavior (#21433)
Negate after casting to unsigned instead of before, avoiding signed
integer overflow when offset is ZEND_LONG_MIN. The same pattern existed
in the pdo_sqlite and sqlite3 stream seek handlers.

Closes GH-20964
Closes GH-20927
2026-06-20 19:01:46 -04:00
Daniel Scherzer 825cb52731 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update NEWS after upmerge
  Preserve class-name case in ReflectionClass::getProperty() (#22272)
2026-06-14 10:24:27 -07:00
Daniel Scherzer 98b5660c1d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Preserve class-name case in ReflectionClass::getProperty() (#22272)
2026-06-14 10:13:40 -07:00
Jorg Adam Sowa f75ae843fc Preserve class-name case in ReflectionClass::getProperty() (#22272)
When given a "Class::property" argument, getProperty() lowercased the
class part before looking it up, so the "Class ... does not exist"
exception printed the lowercased name and autoloaders received it in
lowercase, breaking case-sensitive (PSR-4) autoloaders.

Pass the class name to zend_lookup_class() as given - it lowercases
internally for the class-table lookup - matching what ReflectionMethod
and ReflectionProperty already do.
2026-06-14 10:12:16 -07:00
Tim Düsterhus 265c0c632b Merge branch 'PHP-8.5'
* PHP-8.5:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:37 +01:00
Tim Düsterhus 1f3390283d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:27 +01:00
Tim Düsterhus b5d6377ada output: Fail starting to output buffer when the output layer is deactivated (#20846)
Fixes php/php-src#20837.
2026-01-10 14:37:52 +01:00
Jordi Kroon 51b1aa160d Fix GH-20858: null pointer dereference in php_mail_detect_multiple_crlf via error_log
close GH-20862
2026-01-10 00:51:25 +00:00
Niels Dossche 77eedd78ef Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:37:16 +01:00
Niels Dossche c35224e11c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:37:11 +01:00
Niels Dossche 0590a34aee Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:36:53 +01:00
Niels Dossche ee0143887d Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
The problem is that the code is doing `php_output_handler_free` in a loop on the output stack,
but prior to freeing the pointer on the stack in `php_output_handler_free` it calls
`php_output_handler_dtor` which can run user code that reallocates the stack,
resulting in a dangling pointer freed by php_output_handler_free.
Furthermore, OG(active) is set when creating a new output handler, but
the loop is supposed to clean up all handlers, so OG(active) must be
reset as well.

Closes GH-20356.
2025-12-19 19:36:26 +01:00
Daniel Scherzer 3747e9393d Merge branch 'PHP-8.5'
* PHP-8.5:
  Revert "Deprecate returning non-string values from a user output handler (#18932)" (#20455)
2025-11-11 15:23:42 -08:00
Daniel Scherzer 2711864e82 Revert "Deprecate returning non-string values from a user output handler (#18932)" (#20455)
This partially reverts commit d8577d9bfb, and
reverts parts of 07f1cfd9b0.
2025-11-11 15:22:25 -08:00
Ilija Tovilo 999e16a057 Merge branch 'PHP-8.5'
* PHP-8.5:
  memory_limit is not always limited by max_memory_limit
2025-11-11 01:43:01 +01:00
manuel 37e82ea5d0 memory_limit is not always limited by max_memory_limit
Make sure to always duplicate max_memory_limit ini value. Otherwise the alter
ini routine may assume the value hasn't been overwritten, resulting in the
user-specified value being set after the on_modify handler has run.

Fixes GH-17951
Closes GH-19963
2025-11-11 01:42:27 +01:00
Tim Düsterhus 0a7695cd5a Merge branch 'PHP-8.5'
* PHP-8.5:
  PHP 8.5 | UPGRADING: fix entry about new grapheme $locale parameter (#20239)
  uri: Make uri_parser_rfc3986.h usable for external extensions (#20173)
  Fix missing deprecation message for default case statement followed by semicolon (#20172)
2025-10-20 10:32:14 +02:00
Theodore Brown c03215b623 Fix missing deprecation message for default case statement followed by semicolon (#20172)
Follow-up to GH-19215
2025-10-20 10:29:54 +02:00
Jakub Zelenka c07b9cc49d Merge branch 'PHP-8.5' 2025-10-06 10:32:28 +02:00
Nicolas Grekas fc353966f3 Revert deprecation of __sleep and __wakeup (#19966) 2025-10-06 10:30:27 +02:00
Jakub Zelenka 6fbe99964f Add CI for unit tests 2025-10-05 18:40:27 +02:00
Jakub Zelenka c128a1801b Add unit test setup with php_network_connect_socket test 2025-10-05 18:40:27 +02:00
Gina Peter Banyard b4ed215299 core: Warn when non-representable floats are coerced to int (#19760)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#casting_out_of_range_floats_to_int
2025-09-21 23:53:16 +01:00
Arnaud Le Blanc ef9a89f7ec Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
2025-09-19 18:13:55 +02:00
Arnaud Le Blanc 938226083e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
2025-09-19 14:16:48 +02:00
Niels Dossche 7a1bb71127 Fix GH-19480: error_log php.ini cannot be unset when open_basedir is configured
Since the ini message handlers already check for basedir, we need to
drop the basedir check from ini_set. Then we also fix the exceptional
case for the empty string: it should bypass the basedir check.
Furthermore, there was a regression introduced with the error_log
"syslog" check in ddfe269a (inverted check), so we fix that as well.

Closes GH-19487
2025-09-19 14:14:53 +02:00
Gina Peter Banyard f18e99244b Zend: Deprecate __sleep() (#19682)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_sleep_and_wakeup_magic_methods
2025-09-10 08:54:16 +01:00
Tim Düsterhus 37bf0ec961 main: Deprecate deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string (#19606)
* main: Ignore `register_argc_argv` when `SG(request_info).argc` is available

* sapi: Remove hardcoded `register_argc_argv` for CLI SAPIs

This INI is ignored since the previous commit, which makes the hardcoded
setting obsolete.

* main: Deprecate deriving $_SERVER['argc'] and $_SERVER['argv'] from the query string

RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive

* main: Adjust deprecation message for `register_argc_argv`

* NEWS/UPGRADING
2025-09-09 10:34:35 +02:00
Alexandre Daubois 49e3956b70 core: Deprecate using null as an array offset and when calling array_key_exists() (#19511)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
2025-09-04 22:12:24 +01:00
Gina Peter Banyard 8747e9ae18 Zend: Warn when destructuring non-array values (#19439)
RFC: https://wiki.php.net/rfc/warnings-php-8-5#destructuring_non-array_values
2025-08-29 16:06:34 +01:00