1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00
Commit Graph

72276 Commits

Author SHA1 Message Date
Gina Peter Banyard 3a142e77ee ext/session: remove unused progress parameter in early_find_sid_in() 2026-02-06 01:18:46 +00:00
Gina Peter Banyard b657deffc7 ext/session: remove unused macros
This deletes the PS_ADD_VARL(), PS_ADD_VAR(), and PS_DEL_VARL() macros.
2026-02-06 01:18:46 +00:00
Gina Peter Banyard a2c6e6f66a ext/session: remove PS_ENCODE_VARS
By moving the declaration of the variables inside PS_ENCODE_LOOP() macro.
2026-02-06 01:18:46 +00:00
Arshid 10fb64fed7 ext/readline: readline_read_history/readline_write_history returning a boolean value using RETURN_BOOL (#21140) 2026-02-05 18:23:18 +00:00
Arshid d84ad6a532 ext/gd: remove _php_image_output unused argument (#21138) 2026-02-05 17:52:42 +00:00
ndossche 46e8cb9ff4 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix timezone offset with seconds losing precision
2026-02-05 18:39:22 +01:00
ndossche e76044aa0b Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix timezone offset with seconds losing precision
2026-02-05 18:39:18 +01:00
Niels Dossche ee26417b58 Fix timezone offset with seconds losing precision
There are two issues:
1. The 'e' formatter doesn't output the seconds of the timezone even if
   it has seconds.
2. var_dump(), (array) cast, serialization, ... don't include the
   timezone second offset in the output. This means that, for example,
   serializing and then unserializing a date object loses the seconds of
   the timezone. This can be observed by comparing the output of
   getTimezone() for `$dt` vs the unserialized object in the provided test.

Closes GH-20764.
2026-02-05 18:38:54 +01:00
Arshid dcf5cd9195 ext/dom: Returning a boolean value using RETURN_BOOL (#21141) 2026-02-05 17:31:53 +01:00
Gina Peter Banyard 542175ecfa ext/standard: mark ext/random as a required dependency (#21130)
As the shuffle() and array_rand() functions use part of the Random API
2026-02-05 16:09:54 +00:00
Arshid cdae6c38f6 Return from curl_setopt() with RETURN_BOOL() (GH-21136) 2026-02-05 15:14:52 +01:00
Arshid 8ebdbb7630 Return from filter_has_var() with RETURN_BOOL() (GH-21137) 2026-02-05 15:13:35 +01:00
Gina Peter Banyard b56f068756 ext/session: use RETURN_BOOL() when possible 2026-02-05 13:01:38 +00:00
Gina Peter Banyard 713fbeda97 ext/session: no need to free a known zend_string 2026-02-05 13:01:38 +00:00
Gina Peter Banyard f4b38fc9c6 ext/session: use true/false rather than 1/0 2026-02-05 13:01:38 +00:00
Gina Peter Banyard b68122e15b ext/session: use bool type instead of int 2026-02-05 13:01:38 +00:00
Peter Kokot 06dac62747 Remove unused PHP_DL_TEST_EXPORTS and PHP_ZEND_TEST_EXPORTS (#21109)
In current code these aren't used on Windows build. The
PHP_ZEND_TEST_EXPORTS was intended to fix MSVC level 1 (severe) warnings
via 5a04796f76 but __declspec(dllexport)
is now implemented unconditionally.
2026-02-05 00:25:13 +01:00
ndossche b860837b78 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20936: DatePeriod::__set_state() cannot handle null start
2026-02-04 18:36:17 +01:00
ndossche 34a341e59f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20936: DatePeriod::__set_state() cannot handle null start
2026-02-04 18:35:29 +01:00
Niels Dossche 7445b0f6d9 Fix GH-20936: DatePeriod::__set_state() cannot handle null start
The "current" and "end" field also rely on start_ce, which is set by
"start". Therefore, if "current" or "end" are provided, so must "start"
be provided.

Closes GH-20939.
2026-02-04 18:34:38 +01:00
Peter Kokot 345bf38480 Install missing headers (#21125)
These are included in public headers and should therefore be also
installed.

Follow-up of d16e6f52a4
2026-02-04 17:10:53 +01:00
Nurzhan Bazhirov b843e03c83 Zend: Remove unused parameter from zend_dval_to_lval_cap()
The `zend_string *s` parameter became unused after commit f754ffa8b2
(GH-20746) removed the `zend_oob_string_to_long_error()` calls.

This fixes an unused-parameter compiler warning and updates a stale
comment in zend_operators.c that incorrectly stated this function
can emit warnings.

Closes GH-21112
2026-02-04 15:25:42 +01:00
Tim Düsterhus a15ba7672c zend_ini: Make ZEND_INI_GET_ADDR() return a void* pointer (#21119)
* zend_ini: Make `ZEND_INI_GET_ADDR()` return a `void*` pointer

Since the actual type of the storage location is not known, a `void*` is more
appropriate and avoids explicit casts that are no more safe than the implicit
cast from `void*`.

* tree-wide: Remove explicit casts of `ZEND_INI_GET_ADDR()`

* UPGRADING.INTERNALS
2026-02-04 11:11:11 +01:00
Arshid b5abd77bdf [skip ci] Remove unreachable code after zend_error_noreturn calls (GH-21122) 2026-02-03 22:02:43 +01:00
Arshid a5a0ff6448 ext/mysqli: raise ValueError for invalid option in mysqli_options() (#20971)
Closes GH-20968

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2026-02-03 18:27:10 +00:00
Niels Dossche f0f28b763c Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
2026-02-03 18:41:13 +01:00
Niels Dossche 52eb174ba6 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
2026-02-03 18:40:54 +01:00
Niels Dossche b8fc6bd1c8 Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
Split the handler again, or defer to instanceof when performance doesn't
matter.

Closes GH-21108.
2026-02-03 18:36:28 +01:00
Arnaud Le Blanc d16e6f52a4 Generate C enums from internal enums, introduce Z_PARAM_ENUM() (#20917)
Update gen_stubs.php to generate C enums from internal enums, when the stub is annotated with @generate-c-enums. Enum values can be compared to the result of zend_enum_fetch_case_id(zend_object*).

The generated enums are added to separate files named {$extensionName}_decl.h, so that it's possible to include these from anywhere. _arginfo.h files would generate warnings if we tried to include them in a compilation unit that doesn't call the register_{$class} functions, for instance.

Introduce Z_PARAM_ENUM().

* Make ZEND_AST_CONST_ENUM_INIT a 4-children node

* Store enum case id in ZEND_AST_CONST_ENUM_INIT

* Store enum case id in instance

* Expose enum case_id internally

* Generate C enum for internal enums

* Introduce Z_PARAM_ENUM()

* Port extensions
2026-02-03 12:38:04 +01:00
Ilija Tovilo cb51737f41 Merge branch 'PHP-8.5'
* PHP-8.5:
  Tweak zend.max_allowed_stack_size for gh20836_stack_limit.phpt
2026-02-03 00:55:05 +01:00
Ilija Tovilo 9e96c5ff39 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Tweak zend.max_allowed_stack_size for gh20836_stack_limit.phpt
2026-02-03 00:54:56 +01:00
Ilija Tovilo 1f57d04648 Tweak zend.max_allowed_stack_size for gh20836_stack_limit.phpt
Fixes GH-21086
2026-02-03 00:54:25 +01:00
Khaled Alam 32bd33983d Remove unreachable code after zend_error_noreturn calls (GH-20983) 2026-02-02 14:14:15 +01:00
Ayesh Karunaratne 6419618f54 ext/standard: update array_filter $mode param default value to ARRAY_FILTER_USE_VALUE
In GH-15647, the `array_filter` function was changed to throw a
`ValueError` exception when the `$mode` parameter receives an
invalid.

Additionally, it declares a new `ARRAY_FILTER_USE_VALUE`, assigned
(`int 1`) to it.

This changes the default value of the `array_filter` function's
`$mode` parameter to use the new constant, changing it from
`int $mode = 0` to `int $mode = ARRAY_FILTER_USE_KEY)`.

Closes GH-21100.
2026-02-01 10:35:32 +07: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
Niels Dossche 0f4f73a254 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21077: Accessing Dom\Node::baseURI can throw TypeError
2026-01-30 18:14:24 +01:00
Niels Dossche d54e5106b0 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21077: Accessing Dom\Node::baseURI can throw TypeError
2026-01-30 18:14:19 +01:00
Niels Dossche d73b2f782e Fix GH-21077: Accessing Dom\Node::baseURI can throw TypeError
Prior to this patch there was a common read handler, and it relied on
the dom class set in the intern document. However, Dom\Implementation
allows creating DTDs unassociated with a document, so we can't rely on
an intern document and the check fails. This causes the ZVAL_NULL() path
to be taken.
To solve this, just split the handler.

Closes GH-21082.
2026-01-30 18:13:55 +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
Alexandre Daubois e4935cf601 Merge branch 'PHP-8.5'
* PHP-8.5:
  Core: fix missing deprecation when accessing null array key with JIT (#20883)
2026-01-30 16:19:57 +01:00
Alexandre Daubois 4a6e6077ef Core: fix missing deprecation when accessing null array key with JIT (#20883) 2026-01-30 16:18:33 +01:00
cui 7fed075ba6 [skip ci] typo: sucess* to success* (GH-21092) 2026-01-30 14:28:48 +01:00
David Carlier 4876148bbe Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21023: CURLOPT_XFERINFOFUNCTION with invalid callback crash.
2026-01-30 13:10:35 +00:00
David Carlier 2b89919a5d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21023: CURLOPT_XFERINFOFUNCTION with invalid callback crash.
2026-01-30 13:10:27 +00:00
David Carlier b156471a30 Fix GH-21023: CURLOPT_XFERINFOFUNCTION with invalid callback crash.
we check the FCC is properly initialised beforehand in its handler.

close GH-21025
2026-01-30 13:09:44 +00:00
Arshid 9580d47898 ext/ftp: Use STANDARD_MODULE_HEADER instead of STANDARD_MODULE_HEADER_EX (#21088) 2026-01-30 09:05:43 +00:00
David CARLIER ce798afac3 Fix GH-21058: error_log() crash on null destination argument. (#21064)
we preserve the lower branches behavior by letting php_stream_open_wrapper_ex
handling the null path and propagating the exception.

close GH-21064
2026-01-29 19:49:45 +00:00
Arshid 5ce36453d6 [skip ci] Use STANDARD_MODULE_HEADER for ext-date (GH-21080) 2026-01-29 17:19:14 +01:00
Ilija Tovilo db24ca5926 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix segfault when preloading constant AST closure
2026-01-29 13:31:38 +01:00
Ilija Tovilo 2f2b421a48 Fix segfault when preloading constant AST closure
Fixes GH-21059
Closes GH-21071
2026-01-29 13:30:41 +01:00