Commit graph

135835 commits

Author SHA1 Message Date
Niels Dossche
fae25ca2df Move dom_attr_value() into ext/libxml 2024-05-05 10:14:40 +02:00
Gina Peter Banyard
70acd6e9ad
ext/bcmath: Remove unused ODD() macro function 2024-05-05 01:02:46 +01:00
Peter Kokot
04c417a35e
Remove unused always-enabled extension headers (#14042)
These were once used in these files but at this point aren't and are
only causing confusion whether file depends on additional extension.

- locale.h is added in main/SAPI.c for _ENABLE_PER_THREAD_LOCALE
2024-05-04 21:06:29 +02:00
Niels Dossche
8aec95e23f
Fix build on Clang 18 (#14136)
Clang 18 only allows counted_by to work on real flexible array members,
not ones with a zero size. Otherwise you get errors like:
```
ext/opcache/jit/zend_jit_ir.c:149:12: error: 'counted_by' only applies to C99 flexible array members
```
2024-05-04 19:17:42 +02:00
Niels Dossche
bf3c4870b6
Avoid needless memsets by creating a variant of bc_new_num that doesn't memset (#14133)
Also avoid some memsets where we do call bc_new_num.

After:
```
1.2066178321838
1.5389559268951
1.6050860881805
```

Before:
```
1.3858470916748
1.6806011199951
1.9091980457306
```
2024-05-04 17:11:57 +02:00
Saki Takamachi
1ae58d4784
ext/bcmath: Removed unnecessary zero padding (#14134)
bc_num is initialized to 0 by `memset`, so there is no need to write it to 0.
2024-05-05 00:03:08 +09:00
Niels Dossche
a728e541e9
Remove some dead code from BCMath (#14130)
* Remove unused output.c code

* Remove unused ignore_last parameter from _bc_do_compare()
2024-05-04 16:00:54 +02:00
Niels Dossche
b8abd2693e
Increase test coverage of _bc_do_add() (#14131)
The final carry code was not tested.
2024-05-04 16:00:47 +02:00
Niels Dossche
d2ce90caf8
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14124: Segmentation fault on unknown address 0x0001ffff8041 with XML extension under certain memory limit (#14126)
2024-05-04 14:11:08 +02:00
Niels Dossche
77c21cab2a
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14124: Segmentation fault on unknown address 0x0001ffff8041 with XML extension under certain memory limit (#14126)
2024-05-04 14:11:00 +02:00
Niels Dossche
427c244168
Fix GH-14124: Segmentation fault on unknown address 0x0001ffff8041 with XML extension under certain memory limit (#14126)
The ltags were not initialized, so when an OOM happens before the new value is written, uninitialized data is used.
2024-05-04 14:05:24 +02:00
Niels Dossche
22a113b99c
Try to use an interned local name in createElementNS (#14127) 2024-05-04 13:59:43 +02:00
Niels Dossche
234b3cb241
Fix GH-14124: Segmentation fault on unknown address 0x0001ffff8041 with XML extension under certain memory limit (#14126)
The ltags were not initialized, so when an OOM happens before the new value is written, uninitialized data is used.
2024-05-04 13:57:50 +02:00
武田 憲太郎
d9a9696e89
Fix libmysql download to stable URL 2024-05-04 17:54:18 +09:00
Saki Takamachi
4b95da6163
Merge branch 'PHP-8.3'
* PHP-8.3:
  CI: fix oci setup (#14123)
2024-05-04 17:49:21 +09:00
Saki Takamachi
cd2dea77ff
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  CI: fix oci setup (#14123)
2024-05-04 17:47:55 +09:00
Saki Takamachi
3237b8f471
CI: fix oci setup (#14123)
closes #14123
2024-05-04 17:47:27 +09:00
Saki Takamachi
f442cecab6
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix the MySQL Server version used for testing to  (#14120)
2024-05-04 07:49:46 +09:00
武田 憲太郎
febbbfac78
Fix the MySQL Server version used for testing to (#14120)
closes #14120
2024-05-04 07:49:07 +09:00
Peter Kokot
4465e5082c
Use AC_SEARCH_LIBS for socketpair, gethostname and gethostbyaddr (#14116)
The socketpair():
* C library: Solaris 11.4 and most other systems
* libsocket: Solaris <= 11.3 and illumos
* libnetwork: Haiku

The gethostname() check is moved to AC_CHECK_FUNCS:
* C library: most systems
* libnsl: none
* libnetwork: Haiku (which is already checked in the libraries section)

The gethostbyaddr():
* C library: most systems, Solaris 11.4
* libnsl: Solaris 11.3, illumos
* libnetwork: Haiku

This also removes redundant unused symbols:
- HAVE_GETHOSTBYADDR
- HAVE_LIBNETWORK
- HAVE_LIBNSL

The outdated comment about -lnsl and -lsocket linking has been removed
because these systems are long not supported anymore and this issue is
not relevant anymore like mentioned. The initial solution was different
than the one with the PHP_CHECK_FUNC macros at the current versions.
See commit a188fac946 where the
gethostbyaddr() was checked conditionally based on the gethostname()
availability in libc. Main issue was mostly related to the redundant nsl
library being always linked because of the AC_CHECK_LIB.
2024-05-03 19:55:24 +02:00
Niels Dossche
cad0e555ac
Faster validation logic in bc_str2num() (#14115)
Using SIMD to accelerate the validation.

Using the benchmark from #14076.

After:
```
1.3504369258881
1.6206321716309
1.6845638751984
```

Before:
```
1.4750170707703
1.9039781093597
1.9632289409637
```
2024-05-03 17:34:38 +02:00
Niels Dossche
039344cf70 Avoid extra inits while flooring or ceiling 2024-05-02 20:03:59 +02:00
Niels Dossche
34b2116eb5 Avoid unnecessary destruction in bc_mul() 2024-05-02 20:03:59 +02:00
Niels Dossche
0cd952d851 Avoid unnecessary destruction in bc_sub() 2024-05-02 20:03:59 +02:00
Niels Dossche
959e11544c Avoid unnecessary destruction in bc_add() 2024-05-02 20:03:59 +02:00
Niels Dossche
a604d1d342 Use SSE2 in bc_copy_and_shift_numbers() if possible 2024-05-02 20:03:59 +02:00
Niels Dossche
4964c5cb23 Move bc_copy_num to header to allow inlining 2024-05-02 20:03:59 +02:00
Niels Dossche
be072d7be4 Use RETVAL_NEW_STR
The strings are always new, not interned.
2024-05-02 20:03:59 +02:00
Matteo Beccati
36f9d18e27
Merge branch 'PHP-8.3' 2024-05-02 19:53:43 +02:00
Matteo Beccati
f26b964332
Merge branch 'PHP-8.2' into PHP-8.3 2024-05-02 19:53:27 +02:00
Matteo Beccati
6fed9a9a7e
Stick to mysql 8.3 for the time being
MySQL 8.4 does not load the 'mysql_native_password' plugin by default
and I couldn't figure out how to initialise the container to load it.
2024-05-02 19:53:05 +02:00
Peter Kokot
8c8287abf6
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix tests for glibc 2.39 (#14097)
2024-05-01 20:43:53 +02:00
Peter Kokot
49b5ab2057
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix tests for glibc 2.39 (#14097)
2024-05-01 20:43:42 +02:00
Peter Kokot
b6b9eab68e
Fix tests for glibc 2.39 (#14097)
2.39 has fixed inconsistent (mon_)grouping formats in localedata:

* https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;hb=refs/tags/glibc-2.39#l237
* https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/locales/en_AU;hb=refs/tags/glibc-2.39#l65

For en_AU locale now it returns array of 1 item instead of 2 for
grouping and mon_grouping.

Since this is upstream change depending on the system, this only syncs
tests for such case.
2024-05-01 20:43:00 +02:00
Niels Dossche
a66439adbb
Avoid unnecessary number initializations in BCMath (#14104)
Since freeing can deal with NULL, we can avoid calling bc_init_num and
avoid resetting the number during parsing.

Using benchmark from #14076.

Before:
```
1.544440984726
2.0288550853729
2.092139005661
```

After:
```
1.5324399471283
1.9081380367279
2.065819978714
```
2024-05-01 17:52:06 +02:00
Niels Dossche
b1bb9c34e8
[ci skip] NEWS and UPGRADING 2024-05-01 16:57:36 +02:00
Niels Dossche
0a3ccc0b99
Use bulk conversion in BCMath of BCD/CHAR where possible (#14103)
On my i7-4790 with benchmark from #14076, on top of #14101 I obtain the
following results:

before (with #14101):
```
1.672737121582
2.3618471622467
2.3474779129028
```

after (with #14101 + this):
```
1.5878579616547
2.0568618774414
2.0204811096191
```
2024-05-01 16:48:42 +02:00
Saki Takamachi
cf92a191e8
ext/pdo_sqlite: Use new F ZPP (#14059)
closes #14059
2024-05-01 23:44:41 +09:00
Gina Peter Banyard
6303d1fc6a
ext/sqlite3: Use new F ZPP modifier (#14040) 2024-05-01 15:38:48 +01:00
Niels Dossche
d2d4596f20 Use an unsigned number for the refcount of bcmath objects 2024-05-01 16:18:37 +02:00
Niels Dossche
5dc11de558 Merge n_value and n_ptr 2024-05-01 16:18:37 +02:00
Niels Dossche
3215e86a11 Avoid double allocation in _bc_new_num_ex
Since the two allocations are tied together anyway, we can just use a
single allocation. Moreover, this actually seemed like the intention
because the bc_struct allocation already accounted for the length and
scale.
2024-05-01 16:18:37 +02:00
Gina Peter Banyard
f4dbe2390d
ext/curl: Refactor cURL to only use FCC (#13291)
* ext/curl: Convert handlers.progress to just be a FCC

* ext/curl: Convert handlers.sshhostkey to just be a FCC

* ext/curl: Convert handlers.xferinfo to just be a FCC

* ext/curl: Convert handlers.fnmatch to just be a FCC

* ext/curl: Convert handlers.server_push to just be a FCC

* ext/curl: Convert php_curl_write to just use FCC without a function name zval

* ext/curl: Convert php_curl_read to just use FCC without a function name zval

* ext/curl: Remove workaround for old libcurl

* ext/curl: Create macros to codegen the handling of callable options
2024-05-01 15:09:11 +01:00
Saki Takamachi
0540a4211d
[skip ci] NEWS 2024-05-01 22:31:08 +09:00
Saki Takamachi
10ae87969e
NEWS/UPGRADING 2024-05-01 22:02:43 +09:00
David Carlier
0a134e5d85
Merge branch 'PHP-8.3' 2024-05-01 14:00:03 +01:00
David Carlier
ff6e3b6f76
Merge branch 'PHP-8.2' into PHP-8.3 2024-05-01 13:59:10 +01:00
David Carlier
74843947f4
sapi/cgi: fix buffer limit on windows.
MSDN recommends dropping the deprecated `read` in favor of `_read`.
Also, the buffer size limit is INT_MAX.

Close GH-14022
2024-05-01 13:58:53 +01:00
Saki Takamachi
a481556d31
Refactor BCMath (#14076)
Optimized the order of structure members and the process of converting
strings to bc_num structures.

closes #14076
2024-05-01 21:54:23 +09:00
Niels Dossche
378b015360
Fix Windows failure (#14096) 2024-05-01 00:03:43 +02:00