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

15439 Commits

Author SHA1 Message Date
Weilin Du
2918caee20 ext/*: Remove break after return (#21485) 2026-03-23 20:30:13 +01:00
ndossche
74fad61607 Add test for array_diff() array maximum
Forgot to commit this in 614b22ab.
2026-03-21 22:58:49 +01:00
Gina Peter Banyard
f40b356ad9 Use smart_str_append() if we have a zend_string* (#21414) 2026-03-21 17:06:14 +00:00
ndossche
614b22ab46 Add array size maximum to array_diff()
This silences some reports about the equivalence to array_merge()'s
issue. However, this is different as no packed fill is used in this
code, so it doesn't have the same bug that array_merge() had.

Closes GH-21449.
2026-03-21 10:20:11 +01:00
Ilija Tovilo
8c42cf473e Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix expected output for bug52820.phpt
2026-03-19 13:19:07 +01:00
Ilija Tovilo
f7753608cc Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix expected output for bug52820.phpt
2026-03-19 13:19:01 +01:00
Ilija Tovilo
b97dd3318d Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix expected output for bug52820.phpt
2026-03-19 13:18:54 +01:00
Ilija Tovilo
551809576b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix expected output for bug52820.phpt
2026-03-19 13:18:36 +01:00
Ilija Tovilo
b8b5fb074d Fix expected output for bug52820.phpt
Newer versions of curl seem to omit the "Closing connection ..." message. Make
the entire line optional.
2026-03-19 13:15:57 +01:00
Arshid
9b022c4c5c ext/standard: replace RETVAL_EMPTY_ARRAY() + return with RETURN_EMPTY_ARRAY() (#21464) 2026-03-18 05:30:03 +00:00
Ilija Tovilo
0039af028c Propagate bind error for stream_socket_server()
When stream_socket_server() fails during bind(), we're currently only showing
"Unknown error" in the error message. Properly propagate this error for better
diagnostics.

Closes GH-21328
2026-03-16 08:53:38 +01:00
Arshid
f44609c84d ext/standard: Remove unreachable break after RETURN_STRING (#21459) 2026-03-16 07:40:55 +00:00
Ilija Tovilo
92ba1e4ea0 Prevent closing of innerstream of php://temp stream
Fixes GH-21221
Closes GH-21222
2026-03-13 20:34:04 +01:00
Weilin Du
da1e89fd3d RFC: Add Form Feed in Trim Functions (#20788)
RFC: https://wiki.php.net/rfc/trim_form_feed

Resolves GH-20783.
2026-03-09 22:28:50 +01:00
ndossche
61fd5ceb68 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update ext/standard/libavifinfo
2026-03-07 11:18:33 +01:00
ndossche
37fbbbc4d3 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update ext/standard/libavifinfo
2026-03-07 11:18:29 +01:00
Yannis
c3777c73b3 Update ext/standard/libavifinfo
Fixes GH-20627.
Closes GH-21250.
2026-03-07 11:17:56 +01:00
Peter Kokot
f99ca6347f Windows build: Use GREP_HEADER() instead of CHECK_FUNC_IN_HEADER() (#21315)
This removes the following unused compile definitions:

- HAVE_OSSL_SET_MAX_THREADS
- HAVE_ARGON2ID_HASH_RAW

The CHECK_FUNC_IN_HEADER() function defines the 'HAVE_<FUNCTION>'
compile definitions to 0 or 1, but these aren't used in the code.
Defining such preprocessor macros makes it difficult to track and sync
with other build systems.
2026-03-06 14:11:20 +01:00
Alexandre Daubois
11a95749b1 Convert more zend_parse_parameters_none() to fast ZPP (#21330) 2026-03-04 14:07:46 +01:00
Petr Sumbera
ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
Nora Dossche
84b0a73685 Fix GH-13204: glob() fails if square bracket is in current directory (#19647)
The problem is not limited to square brackets, but to every meta
character. The solution is to override the glob functions for handling
paths with the VCWD ones in PHP. If that is not available, use the old
but limited workaround.
2026-03-03 22:29:07 +01:00
Peter Kokot
f17c5ad83b Windows build: Add new function CHECK_HEADER() (#21191)
The current function `CHECK_HEADER_ADD_INCLUDE()` automatically defines
`HAVE_<HEADER_NAME_H>` preprocessor macros, which makes it difficult to
sync with other build systems. Specially, if some `HAVE_` macro is used
in the code and this function defines this macro but Autotools doesn't.

The new `CHECK_HEADER()` function behaves similar except it doesn't
define the `HAVE_<HEADER_NAME_H>` preprocessor macro.

This removes the following unused compile definitions:

HAVE_ARGON2_H
HAVE_AVIF_H
HAVE_BZLIB_H
HAVE_CAPSTONE_CAPSTONE_H
HAVE_CURL_EASY_H
HAVE_DB_H
HAVE_DECODE_H
HAVE_DEPOT_H
HAVE_EDITLINE_READLINE_H
HAVE_ENCHANT_H
HAVE_ENCODE_H
HAVE_FFI_H
HAVE_FIREBIRD_INTERFACE_H
HAVE_FT2BUILD_H
HAVE_GD_H
HAVE_GLIB_H
HAVE_GMP_H
HAVE_HTTPD_H
HAVE_IBASE_H
HAVE_IR_IR_H
HAVE_KECCAKHASH_H
HAVE_LBER_H
HAVE_LDAP_H
HAVE_LIBEXSLT_EXSLT_H
HAVE_LIBINTL_H
HAVE_LIBPQ_FE_H
HAVE_LIBTIDY_TIDY_H
HAVE_LIBXML_PARSER_H
HAVE_LIBXML_TREE_H
HAVE_LIBXML_XMLWRITER_H
HAVE_LIBXSLT_XSLT_H
HAVE_LMDB_H
HAVE_MBSTRING_H
HAVE_MYSQL_H
HAVE_ONIGURUMA_H
HAVE_OPENSSL_SSL_H
HAVE_PNG_H
HAVE_SNMP_H
HAVE_SODIUM_H
HAVE_SQLITE3_H
HAVE_SQLITE3EXT_H
HAVE_SYBFRONT_H
HAVE_TIDY_H
HAVE_TIDY_TIDY_H
HAVE_TIDYBUFFIO_H
HAVE_TIMELIB_CONFIG_H
HAVE_UNICODE_USPOOF_H
HAVE_UNICODE_UTF_H
HAVE_XPM_H
HAVE_ZIP_H
HAVE_ZIPCONF_H
HAVE_ZLIB_H

The following compile definitions are defined explicitly:

- HAVE_ICONV_H
- HAVE_MSCOREE_H
- HAVE_SQL_H
- HAVE_SQLEXT_H

Additionally, the `SETUP_OPENSSL()` function doesn't accept the 6th
argument anymore.
2026-03-03 20:06:40 +01:00
Ilija Tovilo
a83c025730 Use zend_always_inline for frameless function template functions (GH-21316) 2026-03-03 00:20:34 +01:00
ndossche
bfd66bbdf0 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix compile warnings under GCC 15.2.1 (#21320)
  Updated to version 2026.1 (2026a)
2026-03-02 23:13:40 +01:00
ndossche
210704258a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix compile warnings under GCC 15.2.1 (#21320)
2026-03-02 23:12:48 +01:00
Nora Dossche
583be5a8ca Fix compile warnings under GCC 15.2.1 (#21320)
The compiler now infers constness through string functions.
Adhere to that.
It also now warns about using multiplications in conditions.
2026-03-02 23:12:06 +01:00
ndossche
4b0a4f47f3 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20906: Assertion failure when messing up output buffers
2026-02-27 18:15:26 +01:00
ndossche
38421684c1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20906: Assertion failure when messing up output buffers
2026-02-27 18:15:20 +01:00
ndossche
1709689256 Fix GH-20906: Assertion failure when messing up output buffers
Closes GH-20908.
2026-02-27 18:14:56 +01:00
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
Ilija Tovilo
3bf7d9a7d6 Merge branch 'PHP-8.5'
* PHP-8.5:
  Tweak stack limit values for gh20840.phpt
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:56 +01:00
Ilija Tovilo
48e318f581 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Tweak stack limit values for gh20840.phpt
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:44 +01:00
Ilija Tovilo
f07809f495 Tweak stack limit values for gh20840.phpt
Graciously tested by Andy Postnikov (andypost).

See GH-21086
Closes GH-21275
2026-02-24 02:11:19 +01:00
Ilija Tovilo
9a6a841d77 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Tweak stack limit values for gh20583.phpt
2026-02-24 02:11:09 +01:00
Ilija Tovilo
3692a5fa57 Tweak stack limit values for gh20583.phpt
Graciously tested by Andy Postnikov (andypost).

See GH-21086
Closes GH-21274
2026-02-24 02:10:47 +01:00
Arshid
7b4a7035d6 ext/standard: Cleanup boolean return macros (#21261)
- Replace RETVAL_TRUE/FALSE with RETVAL_BOOL
- Replace RETURN_TRUE/FALSE with RETURN_BOOL
2026-02-23 12:39:25 +00:00
Jorg Adam Sowa
b58087daab test: improve tests for in_array (#21087)
By splitting the massive tests into more specific, smaller tests.
2026-02-23 12:36:38 +00:00
Tim Düsterhus
303104e2bf zend: Define C23 enum zend_class_type (#21241)
Checked for “binary and” comparisons using Coccinelle:

    @@
    struct _zend_class_entry *e;
    expression x;
    @@

    * (e->type & x)

    @@
    zend_class_entry *e;
    expression x;
    @@

    * (e->type & x)
2026-02-17 16:49:45 +01:00
Arshid
d3e4703310 [standard] Simply if -> RETURN_TRUE/FALSE with RETURN_BOOL() (GH-21147) 2026-02-06 10:12:33 +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
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
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
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
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
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
Calvin Buckley
4d5b651e90 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix regression with header removal removing whole prefixes (#21020)
2026-01-28 16:50:26 -04:00