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

145387 Commits

Author SHA1 Message Date
Alexandre Daubois
a8543dfdd2 Convert remaining zend_parse_parameters_none() to ZPP (#21343) 2026-03-16 09:28:08 +01: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
Arshid
45157d24ea ext/zip: Remove unreachable break after RETURN_STRING (#21458) 2026-03-16 07:37:43 +00:00
Peter Kokot
3927630e62 Remove unused config.h inclusion in SAPIs (#21377)
Current PHP SAPIs aren't built outside of php-src and neither is
anywhere described how such configuration header is supposed to be used.
2026-03-15 12:57:20 +01:00
Ilia Alshanetsky
4561e92fa1 Fix ReflectionMethod::invoke() for first class callables (#21389)
* Fix ReflectionMethod::invoke() crash with internal closures

The closure identity check added in GH-21366 accessed op_array.opcodes
unconditionally, but internal closures (e.g. var_dump(...)) use
internal_function, not op_array. This caused undefined behavior when
comparing closures created via first-class callable syntax on internal
functions.

Check the function type first: compare op_array.opcodes for user
closures, compare the function pointer directly for internal closures.

* Fix internal closure comparison and expand test coverage

The previous comparison (orig_func == given_func) could never match for
internal closures since zend_get_closure_method_def() returns a pointer
to each closure's embedded copy. Compare function_name and scope instead.

Also handle the mixed user/internal type case explicitly.

Add tests for: userland first-class callables, cloned internal closures,
and cross-type (user vs internal) closure rejection.

* php_reflection: Simplify the Closure::__invoke() check

---------

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2026-03-14 17:00:04 -07:00
David Carlier
7e16d4e5f8 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/gd: phpinfo() to be able to display libjpeg 10.0 support.
2026-03-14 18:24:55 +00:00
David Carlier
277a016723 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/gd: phpinfo() to be able to display libjpeg 10.0 support.
2026-03-14 18:24:17 +00:00
David Carlier
e257c086bb ext/gd: phpinfo() to be able to display libjpeg 10.0 support.
Fix #21431

Co-Authored-By: rainerjung

close GH-21432
2026-03-14 18:23:35 +00:00
Daniel Scherzer
91134db95d ReflectionFiber::getCallable(): remove stray backslash (#21439) 2026-03-14 10:11:33 -07:00
ndossche
c197fada93 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/zip: Fix const-generic compile warning
2026-03-14 15:07:26 +01:00
ndossche
e0ac74fb52 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/zip: Fix const-generic compile warning
2026-03-14 15:07:06 +01:00
ndossche
b95f0ebc47 ext/zip: Fix const-generic compile warning 2026-03-14 15:06:57 +01:00
Tim Starling
605c0756c9 ext/zip: add ZipArchive::openString() method
Fixes to GH-14078:

* Rename ZipArchive::openBuffer() to ::openString().
* For consistency with ::open(), return int|bool, don't throw an
  exception on error. Provide error information via existing properties
  and accessors.
* Fix memory leak when ::openString() is called but ::close() is not
  called. Add test.
* Fix memory leak when a call to ::open() is followed by a call to
  ::openString(). Add test.
* Let libzip own the source, don't call zip_source_keep().
* Share buffer handling with ZipArchive::addFromString().

Elsewhere:

* If there is an error from zip_close() during a call to
  ZipArchive::open(), emit a warning but proceed to open the archive,
  don't return early. Add test.
* When buffers are saved by ZipArchive::addFromString(), release them
  in ZipArchive::close() and ::open(), don't accumulate buffers until
  the free_obj handler is called.
* Factor out buffer handling and reuse it in ZipArchive::openString()

Closes GH-21205.
Closes GH-14078.

Co-authored-by: Soner Sayakci <s.sayakci@shopware.com>
Co-authored-by: Ghaith Olabi <24876890+Gaitholabi@users.noreply.github.com>
2026-03-14 15:03:36 +01:00
Arshid
006f141dd6 ext/phar: Use zend_string_concat2 instead of manual zend_string_alloc/memcpy (#21441) 2026-03-14 14:28:00 +01:00
Arshid
a5ffcf3b1a Use zend_string_init_fast() for single-character string creation (#21438) 2026-03-14 10:50:21 +01:00
武田 憲太郎
31962aa086 ext/pgsql: Enable lo_tell64/lo_truncate64 by removing dead VE_PG_LO64 guards
The guards reference undefined VE_PG_LO64, a misspelling of
HAVE_PG_LO64 (removed in GH-14628), making the 64-bit code paths
permanently dead. Remove the guards to unconditionally enable the
64-bit variants for PostgreSQL >= 9.3, consistent with pg_lo_seek().

Dropped from GH-21386 as not suitable for backport.

close GH-21437
2026-03-14 05:22:43 +00:00
Arshid
a2fc8feb4c ext/openssl: openssl: use zend_string_init() instead of manual allocation (#21436) 2026-03-14 05:13: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
Ilija Tovilo
80b1ede843 [skip ci] Fix uninitialized fn_flags2 for internal functions
This field is still unused on master, but required for GH-19941.
2026-03-13 20:26:31 +01:00
Arshid
44d4f0e45a ext/soap: Use smart_str_appends() instead of smart_str_appendl(..., strlen(...)) (GH-21426) 2026-03-13 16:05:06 +01:00
Arshid
5ccaccda97 ext/reflection: Use smart_str_append instead of smart_str_appendl (#21413) 2026-03-12 17:14:03 -07:00
ndossche
a026333cc2 Merge branch 'PHP-8.5'
* PHP-8.5:
  [ci skip] NEWS for GH-20838
2026-03-12 22:04:36 +01:00
ndossche
ed3eb8519a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [ci skip] NEWS for GH-20838
2026-03-12 22:04:32 +01:00
ndossche
9150226166 [ci skip] NEWS for GH-20838 2026-03-12 22:04:08 +01:00
ndossche
e9b3ea82b5 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
2026-03-12 22:02:01 +01:00
ndossche
757dadcf1f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
2026-03-12 22:01:21 +01:00
Ilia Alshanetsky
7950482562 Fix GH-21083: Skip private_key_bits validation for EC/curve-based keys
openssl_pkey_new() checks private_key_bits >= 384 before generating any
key. For EC, X25519, ED25519, X448, and ED448 the size is inherent to
the curve or algorithm, so this check doesn't apply and causes failures
when default_bits is missing from openssl.cnf (which is the case in
OpenSSL 3.6's default config).

Skip the minimum-bits check for key types that don't use private_key_bits.

Closes GH-21387.
2026-03-12 21:53:22 +01:00
David CARLIER
b0aa6b9626 ext/soap: various optimisations
* replace strcat/strncpy with memcpy for pre-allocated buffers.
* remove redundant memset before struct copy.
2026-03-12 17:56:43 +00:00
ndossche
46357cbaaf dom: Merge declaration and assignment 2026-03-12 17:48:38 +01:00
ndossche
28c6659b06 dom: Simplify return value management of xpath callback 2026-03-12 17:48:38 +01:00
Gina Peter Banyard
113893b714 Zend: create a IS_VOID type AST rather a string (#21415) 2026-03-11 22:39:09 +00:00
ndossche
8b7c70da21 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21357: XSLTProcessor works with DOMDocument, but fails with Dom\XMLDocument
2026-03-11 22:31:39 +01:00
ndossche
a3f486dfa3 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21357: XSLTProcessor works with DOMDocument, but fails with Dom\XMLDocument
2026-03-11 22:31:33 +01:00
ndossche
284fd7779d Fix GH-21357: XSLTProcessor works with DOMDocument, but fails with Dom\XMLDocument
Registering namespace after the parsing is too late because parsing can
fail due to attributes referencing namespaces.
So we have to register fake namespaces before the parsing.
However, the clone operation reconciles namespaces in the wrong way, so
we have to clone via an object.

Closes GH-21371.
2026-03-11 22:31:03 +01:00
Calvin Buckley
13b83a46cf Bump libtool to serial 63 from 2.5.4 (#21067)
The libtool 1.5.26 is bundled with PHP since the very early days of the
Autotools build system to ease the building process and avoid additional
dependency on the system Libtool. This updates the bundled libtool to
2.5.4 version.

Fixes and implementations:

- Fixed race conditions when building PHP in parallel ("cannot create
  .libs" warnings).
- Implements request https://bugs.php.net/70374 (Update libtool.m4)
- Fixes libtool eating -flto flags.
- Fixes GH-17310 (configure producing errors on macOS)
- Fixes GH-15946 (./configure error when building with NixOS)

Changes:
- Add a script to update autotools files.
- libtool is spread across multiple files; phpize is updated to handle
  this.
- Remove outdated hacks, i.e. for `ar`.
- Remove documentation references to external libtool, as we vendor it.
- `--with-pic` is now `--enable-pic`. Error out on the old flag.
- On macOS linker now uses -undefined dynamic_lookup flag for shared
  extensions and shared embed SAPI (libphp) instead of older
  '-undefined suppress -flat_namespace' combination.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2026-03-11 12:37:56 -03:00
Dmitry Stogov
79556df7ee Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20838: JIT compiler produces wrong arithmetic results (#21383)
2026-03-11 15:23:22 +03:00
Dmitry Stogov
35ee95a827 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20838: JIT compiler produces wrong arithmetic results (#21383)
2026-03-11 15:23:12 +03:00
Ilia Alshanetsky
80dc4c19d6 Fix GH-20838: JIT compiler produces wrong arithmetic results (#21383)
Insert type guards (CHECK_OP1_TRACE_TYPE / CHECK_OP2_TRACE_TYPE) on the
sensitive bailout paths in ADD/SUB/MUL JIT compilation: the MAY_BE_UNDEF
and non-numeric operand breaks. Guards are only emitted when the traced
operand type is IS_LONG or IS_DOUBLE, ensuring TSSA result type
predictions stay valid for side traces without affecting the normal
numeric fast path.


Fixes GH-20838

Co-authored-by: Dmitry Stogov <dmitrystogov@gmail.com>
2026-03-11 15:22:50 +03:00
Gina Peter Banyard
c658d3c787 ext/pgsql: use smart_str_append_double() instead of snprintf call (#21406) 2026-03-11 01:51:53 +00:00
David Carlier
ed887241be Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
2026-03-10 22:01:03 +00:00
David Carlier
f04873c1b8 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
2026-03-10 21:59:38 +00:00
David Carlier
1b61d555fb ext/soap: Fix wrong cookie options offset calculation, using separator offset instead.
The cookie option parser uses a wrong offset to start scanning
attributes, causing cookie values containing substrings like
"path=" or "domain=" to be falsely matched as attributes.

close GH-21400
2026-03-10 21:58:52 +00:00
Gina Peter Banyard
7f20223143 ext/soap: use zend_string_equals_literal() instead of strcmp() (#21405) 2026-03-10 20:13:05 +00:00
ndossche
9a73c009f3 Merge branch 'PHP-8.5'
* PHP-8.5:
  soap: Fix const violation
2026-03-10 21:08:56 +01:00
ndossche
f33091c972 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  soap: Fix const violation
2026-03-10 21:08:51 +01:00
ndossche
c4c1261196 soap: Fix const violation 2026-03-10 21:06:20 +01:00
ndossche
d3055912b7 Merge branch 'PHP-8.5'
* PHP-8.5:
  soap: Fix const-generic compile warning
2026-03-10 20:52:05 +01:00
ndossche
bc0871dd3d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  soap: Fix const-generic compile warning
2026-03-10 20:52:00 +01:00
ndossche
ae0bf447b4 soap: Fix const-generic compile warning 2026-03-10 20:51:51 +01:00