Commit Graph

67837 Commits

Author SHA1 Message Date
Dmitry Stogov
bdcb2185aa
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15820: Core dumped with jit.opcache=1245
2024-09-10 15:45:00 +03:00
Dmitry Stogov
43202d2bfa
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15820: Core dumped with jit.opcache=1245
2024-09-10 15:44:24 +03:00
Dmitry Stogov
5cf045d357
Fix GH-15820: Core dumped with jit.opcache=1245 2024-09-10 15:42:23 +03:00
Niels Dossche
201c691fab
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix buffer size configuration for AArch64
2024-09-09 22:02:52 +02:00
Niels Dossche
f8486c7ddc
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix buffer size configuration for AArch64
2024-09-09 22:02:46 +02:00
Niels Dossche
bcd1f23b30
Fix buffer size configuration for AArch64 2024-09-09 22:02:39 +02:00
Niels Dossche
23db89538b
Fix merge into master 2024-09-09 21:00:05 +02:00
Niels Dossche
90b91d3974
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15658: Segmentation fault in Zend/zend_vm_execute.h
2024-09-09 20:26:50 +02:00
Niels Dossche
d2a5c98797
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15658: Segmentation fault in Zend/zend_vm_execute.h
2024-09-09 20:26:44 +02:00
Niels Dossche
c1ffd4b484
Fix GH-15658: Segmentation fault in Zend/zend_vm_execute.h
Implement a minimal ZEND_MATCH handler using a tail call.

Closes GH-15782.
2024-09-09 20:26:16 +02:00
Niels Dossche
f56a659293
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
2024-09-09 20:12:07 +02:00
Niels Dossche
75f5cbf89e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
2024-09-09 20:12:01 +02:00
Niels Dossche
86ef8d5466
Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
Closes GH-15666.
2024-09-09 20:10:16 +02:00
Niels Dossche
8bcfc8cc13
Implement request #47317: SoapServer::__getLastResponse()
Convenient for debugging.

Closes GH-15792.
2024-09-09 20:07:29 +02:00
Niels Dossche
5048a0650a
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix SOAP test failure on libxml2 2.13
2024-09-09 20:04:39 +02:00
Niels Dossche
1fdd79caf7
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix SOAP test failure on libxml2 2.13
2024-09-09 20:04:30 +02:00
Niels Dossche
979e68a2ec
Fix SOAP test failure on libxml2 2.13
libxml2 2.13 has different formatting behaviour: it outputs `<faultcode/>`
instead of `<faultcode></faultcode>`, and similarly for `env:Value`.
Normalize the output.

Closes GH-15801.
2024-09-09 20:04:15 +02:00
Niels Dossche
b7b492b184
Deduplicate URI building code in soap schema code (#15799) 2024-09-09 19:44:09 +02:00
Ilija Tovilo
6ed730eb59
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix MSAN getservbyport() false positive
  Fix uninitialized CG(zend_lineno)
  Fix uninitialized EG(user_error_handler_error_reporting)
2024-09-09 19:35:09 +02:00
Ilija Tovilo
a5bd4ccb8c
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix MSAN getservbyport() false positive
  Fix uninitialized CG(zend_lineno)
  Fix uninitialized EG(user_error_handler_error_reporting)
2024-09-09 19:35:00 +02:00
Ilija Tovilo
0faa1d2017
Fix MSAN getservbyport() false positive
Closes GH-15814
2024-09-09 19:34:43 +02:00
Ilija Tovilo
24a294922b
Fix uouv in array_column
column_long and index_long might not be set, but are still used as arguments.
They are not actually used if column_str is set, but it's better to initialize
them anyway, if only to make MemorySanitizer happy.
2024-09-09 16:55:02 +02:00
Dmitry Stogov
d670ee7d03
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix OPcache tests under specific conditions
2024-09-09 10:00:47 +03:00
Dmitry Stogov
94f5ef09a0
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix OPcache tests under specific conditions
2024-09-09 10:00:41 +03:00
Go Kudo
d966c296d0
Fix OPcache tests under specific conditions 2024-09-09 10:00:25 +03:00
Dmitry Stogov
d0acf3012e
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix OPcache tests under specific conditions
2024-09-09 09:57:49 +03:00
Dmitry Stogov
fb2266b1ca
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix OPcache tests under specific conditions
2024-09-09 09:56:37 +03:00
Go Kudo
bca5f6e74f
Fix OPcache tests under specific conditions 2024-09-09 09:55:52 +03:00
Dmitry Stogov
4c11168f60
Fix GH-15656: php8.4beta4 JIT erronous results (#15732)
* Improve trace SSA construction and type inference

* Fix incorrect abstract stack maintenance

* Add missing register store

* Avoid IR binding for the dangerous case

* Fix access to possibly uninitilezed variable

* Improve trace SSA construction and type inference

* Fix IR constuction

Force load values into regesters before any branches to guarantee SSA
dominance property
2024-09-09 09:28:57 +03:00
Peter Kokot
dfdec2d550
Autotools: Refactor PHP_TEST_BUILD checks (#15798)
- The libgd sanity check is there only to check whether all current
  linked libraries for the bundled libgd work together, otherwise it is
  probably even redundant a bit; this refactors it to a simpler
  AC_LINK_IFELSE check with default empty C program by Autoconf
- The IBM DB2 sanity check is simplified with AC_CHECK_FUNC instead
2024-09-08 21:05:30 +02:00
Christoph M. Becker
50b3a0d011
Add comments about internal headers (GH-15689)
A common convention is to name internal C header files as `*_int.h`.
Since a couple of these are actually installed, we add comments that
this is not supposed to happen, (a) to avoid installing further
internal headers, and (b) to pave the way to fix this in the next major
PHP version.

Somewhat special is php_gmp_int.h, where "int" is meant as abbreviation
for "interface".

Another common convention is appending `_priv` or `_private`, but since
there have not been any issues regarding these headers so far, we
refrain from adding respective comments to these headers.

Anyhow, it might be a good idea to introduce some common naming
convention for such internal/private headers.
2024-09-08 16:11:25 +02:00
Niels Dossche
7771ec07e5
Fix bug #61525: SOAP functions require at least one space after HTTP header colon
HTTP/1.1 does not require a single whitespace after the colon, and
SoapServer does implement HTTP/1.1. The header value is already correctly
whitespace-trimmed, so no behaviour change happens w.r.t. header values.

Closes GH-15793.
2024-09-08 10:42:30 +02:00
Peter Kokot
0f3b2e506b
Autotools: Move extension setup to main check (#15797)
Also, redundant PHP_MBREGEX check is removed and wrapped in a single
"if" check.
2024-09-08 08:31:21 +02:00
Niels Dossche
ac0931d37a Reuse bcmath_check_scale() 2024-09-07 12:26:59 +02:00
Niels Dossche
2e88916b58 Move bcmath_check_scale() 2024-09-07 12:26:59 +02:00
Niels Dossche
f1b4e1276c Simplify bcmath_check_scale()
The scale is default-initialized to 0, so we can simplify the code a
bit.
2024-09-07 12:26:59 +02:00
Peter Kokot
5ea6b044cd
Autotools: Fix gd extension -I flag for bundled libgd (#15786)
The ext_srcdir variable is at time of writing set only after calling the
PHP_NEW_EXTENSION. Other extensions also use @ext_srcdir@ template
placeholder for these cases. This fixes wrongly set include flag even
though build also works without libgd include flag.
2024-09-07 09:46:06 +02:00
Bob Weinand
25d761623c
Make internal run_time_cache a persistent allocation (#15040)
We also add zend_map_ptr_static, so that we do not incur the overhead of constantly recreating the internal run_time_cache pointers on each request.
This mechanism might be extended for mutable_data of internal classes too.
2024-09-07 01:45:26 +02:00
Derick Rethans
2f3224ea41
Updated to version 2024.2 (2024b) 2024-09-06 12:33:39 +01:00
Derick Rethans
7023fb9d93
Updated to version 2024.2 (2024b) 2024-09-06 12:33:37 +01:00
Derick Rethans
5fc37b1ec6
Updated to version 2024.2 (2024b) 2024-09-06 12:33:36 +01:00
Christoph M. Becker
6732b8892d
Support --openssl-legacy-providers on Windows, too (GH-15747)
This is not necessarily useful for Windows (few use custom builds on
that platform), but for feature parity with other platforms it seems
reasonable to support it on Windows.

We make sure, though, that the feature is not enabled for snapshot
builds by adding the option to the build exclusions.
2024-09-05 10:49:16 +02:00
Peter Kokot
438b781a80
Update skeleton extension .gitignore (#15738)
This adds:

- config.cache produced by: ./configure -C
- config.nice.bat, configure.js and configure.bat on Windows when using
  phpize

[skip ci]
2024-09-05 07:14:29 +02:00
Daniel Scherzer
29f9f903b1
backporting GH-15755 fix. 2024-09-05 02:02:36 +01:00
David Carlier
1e62d203a6
Merge branch 'PHP-8.3' 2024-09-05 01:55:58 +01:00
David Carlier
ea83eba590
Merge branch 'PHP-8.2' into PHP-8.3 2024-09-05 01:41:55 +01:00
Daniel Scherzer
c5e0a6aaab
Fix GH-15752: finfo_file() - parameter validation error messages
Show the correct parameter names and numbers - the errors are caused by the
second parameter being empty or having null bytes, not the first.

close GH-15755
2024-09-05 01:41:15 +01:00
Levi Morrison
6435bb5ae1
Interrupt while internal frame is on the stack (#14627)
* Check VM interrupt while internal frame is on top

* Use tab instead of spaces

* fix frame used in interrupt and refactor

* remove unused failures for zend_jit_check_timeout

* Fix JIT support

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>

* Fix the missing store to vm_interrupt

* Rename new functions

* Special case zend_interrupt_function in JIT code

* refactor to use ZEND_VM_SET_OPCODE_NO_INTERRUPT

* Split atomic exchange into load + store

It is difficult to determine performance of atomics sometimes. In this
case, the separate load+store is still correct, and a load does not
cause a modification, and might be faster for some platforms than an
exchange. A load+store is slower than an exchange, but we're fine
trading the penalty to the slow path and keeping the happy path faster.

---------

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2024-09-05 00:35:55 +02:00
Peter Kokot
816aea797b
Autotools: Mark always-shared extensions with ext_shared variable (#15739)
This makes future config.m4 files changes simpler in case of adding
additional checks, macro calls etc. Or if these extensions configuration
would change at some point.
2024-09-04 23:28:29 +02:00
Christoph M. Becker
1d36927127
Support SHA256_Transform_shani() with MSVC, too
Closes GH-15312.
2024-09-04 18:07:59 +02:00
Christoph M. Becker
5d1181fb3f
Fix GH-15742: php_hash_sha.h incompatible with C++
Not only MSVC doesn't support this construct, but apparently it is
generally not supported by C++ compilers.

Closes GH-15745.
2024-09-04 17:25:43 +02:00
Christoph M. Becker
217ea732fc
Use php_error_docref() instead of zend_error() in session.c (GH-15505)
Using `php_error_docref()` is preferable since it outputs additional
details (which function has been called and whether it is a startup or
shutdown error), uses HTML markup, and also provides a link to the
documentation, if configured.

Since these deprecation warnings have been introduced recently[1][2],
i.e. for PHP 8.4, there are no BC concerns.

[1] <e8ff7c70f9>
[2] <b36eac94d2>

Co-authored-by: Máté Kocsis <kocsismate90@gmail.com>
2024-09-04 16:00:28 +02:00
DanielEScherzer
5dd0575698
Generated arginfo header files: combine preprocessor conditional blocks (#15736)
When functions' or class methods' availability is based on some preprocessor
condition, the generated arginfo header files wrap the declarations in the
preprocessor `#if` conditional blocks, one per declaration, even if they are in
the same conditional block based on comments in the stub file. Instead of
having multiple conditional blocks one after the other with the same condition,
combine them into a single conditional block.
2024-09-04 13:04:22 +02:00
Ayesh Karunaratne
24d4ae9d2f
ext/curl: No-op CURLOPT_DNS_USE_GLOBAL_CACHE constant (GH-15127)
Libcurl `CURLOPT_DNS_USE_GLOBAL_CACHE` constant is no longer supported
since libcurl[^1] 7.62. This no-ops the constant, but without causing
any deprecation notices.

[^1]: [CURLOPT_DNS_USE_GLOBAL_CACHE](https://curl.se/libcurl/c/CURLOPT_DNS_USE_GLOBAL_CACHE.html)
2024-09-04 12:40:45 +02:00
Saki Takamachi
fad899e566
[RFC] Support object types in BCMath (#13741)
Added BcMath\Number class. It is an immutable object, has methods that are
equivalent to existing BCMath calculation functions, and can also be calculated
using operators.

The existing BCMath function returned a string for each calculation, but this
class returns an object.

RFC: https://wiki.php.net/rfc/support_object_type_in_bcmath,
https://wiki.php.net/rfc/fix_up_bcmath_number_class

---------

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-09-04 11:12:51 +09:00
Peter Kokot
13f041163c
Remove Travis artefacts (#15714)
Travis was suspended https://github.com/php/php-src/pull/15314

This removes 404 errored Travis image in README, travis configuration
directory and YAML file and usages in tests.

[skip ci]

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-09-04 01:15:10 +02:00
Peter Kokot
9a9e178328
Autotools: Enhance appending -lrt (#15719)
If the opcache extension would be built statically one day this also
takes care of this to make the check more ubiquitous.
2024-09-04 00:43:21 +02:00
DanielEScherzer
53cb89670c
Generated arginfo header files: remove empty zend_function_entry arrays (#15705)
When a class (or enum) has no methods, rather than using an array that only
contains `ZEND_FE_END`, use `NULL` for the functions. The implementation of
class registration for internal classes, `do_register_internal_class()` in
zend_API.c, already skips classes where the functions are `NULL`. By removing
these unneeded arrays, we can reduce the size of the header files, while also
removing an unneeded call to zend_register_functions() for each internal class
with no extra methods.
2024-09-03 23:19:53 +02:00
Máté Kocsis
7dfbf4d1b7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Add missing return for DatePeriod::__unserialize
2024-09-03 21:32:03 +02:00
Máté Kocsis
1663ed6c6e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add missing return for DatePeriod::__unserialize
2024-09-03 21:31:00 +02:00
Máté Kocsis
6cab76986d
Add missing return for DatePeriod::__unserialize
Additionally, add other RETURN_THROWS() defensively.
2024-09-03 21:27:50 +02:00
Christoph M. Becker
8a2015451a
Fix dba tests wrt resource to object conversion (GH-15716)
We should not pretend that there are still user-visible resources,
since we're dealing with objects now.
2024-09-03 14:23:57 +02:00
Christoph M. Becker
3892529fed
Close-GH 15685: improve proc_open error reporting on Windows
While similar errors are already reported via `strerror()` on other
platforms, this has apparently overlooked for Windows, where only the
error code has been reported so far.

We adapt the affected test cases, but since there is no PHP userland
function which allows us to get the current system locale, we work
around.

Closes GH-15687.
2024-09-03 13:12:27 +02:00
Daniel Scherzer
18df69ee34
ReflectionProperty::get{Hook,Hooks}(): handle dynamic properties
For dynamic properties, instead of crashing with a segmentation fault, just say
that there are no hooks. Also includes a test to prevent regression.

Fixes GH-15718
Closes GH-15721
2024-09-03 11:31:15 +02:00
Dmitry Stogov
a7f789ec56
Update IR
IR commit: 17fa2605a526d9512224123c0e7e565307a17fe9
2024-09-03 10:26:14 +03:00
Niels Dossche
98dc77f660
Fix GH-15690: ext-dba failures on 32-bit (#15691)
The wrong type was used in the size calculation. On 64-bit this
coincidentally doesn't cause issues, but on 32-bit it does because of
different padding vs 64-bit resulting in a different size.

Regressed in 2097237.
2024-09-02 21:46:05 +02:00
Dmitry Stogov
faa1904fb6
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15652: Segmentation fault in the Zend engine when JIT enabled (#15717)
2024-09-02 21:59:14 +03:00
Dmitry Stogov
be8589651d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15652: Segmentation fault in the Zend engine when JIT enabled (#15717)
2024-09-02 21:55:40 +03:00
Dmitry Stogov
1e78cf941c
Fix GH-15652: Segmentation fault in the Zend engine when JIT enabled (#15717) 2024-09-02 21:55:19 +03:00
Peter Kokot
45ebe47569
Autotools: Sync CS in ext/openssl 2024-09-02 18:39:11 +02:00
Christoph M. Becker
6d5962074f
Dynamically xfail test cases which fail on CI (GH-15710)
This is a stop-gap measure for GH-15709 to keep CI green.
2024-09-02 18:23:52 +02:00
Remi Collet
32c5ce3451
Implement GH-13514 PASSWORD_ARGON2 from OpenSSL 3.2 (#13635)
* Implement GH-13514 PASSWORD_ARGON2 from OpenSSL 3.2

* simplify init/shutdown

* use php_base64_encode_ex

* - rename macros - use openssl RAND_bytes - CS

* add --with-openssl-argon2 build option

* check OSSL_KDF_PARAM_ARGON2_LANES instead of OSSL_set_max_threads

* Cleanup and CS

* save/restore old threads config + CS

* remove unneeded check
2024-09-02 13:01:09 +02:00
Peter Kokot
de6658531f
Autotools: Fix iconv shared build with external library (#15686)
When building iconv as shared and with external library (for example, libiconv):

    ./configure --with-iconv=shared,/path/to/libiconv

the iconv couldn't be found due to a linker error.

Autoconf places LDFLAGS before the conftest.c file in the test compile
command and LIBS after it. GCC also requires this:

    gcc -L... conftest.c -liconv

Similar issue discovered at
https://github.com/remicollet/php-xpass/pull/1
2024-09-01 22:06:37 +02:00
Christoph M. Becker
c013679b70
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15552: Signed integer overflow in ext/standard/scanf.c
2024-09-01 17:26:46 +02:00
Christoph M. Becker
a51f54b54b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15552: Signed integer overflow in ext/standard/scanf.c
2024-09-01 17:25:18 +02:00
Christoph M. Becker
08841bf79c
Fix GH-15552: Signed integer overflow in ext/standard/scanf.c
We ensure that the argnum `value` is in the allowed range, *before*
mapping it to the `objIndex`, not *afterwards*.

Closes GH-15581.
2024-09-01 17:24:17 +02:00
Christoph M. Becker
0b1e401f2c
Skip tests calling wmic if it is not available
The WMIC utitlity is deprecated as of Windows 10 21H1, and a feature on
demand which is enabled by default in Windows 11 22H2 and 23H2, but
will be disabled by default in the next release of Windows.[1]

Therefore, we ensure that tests which rely on wmic.exe are properly
skipped if it is not available.

[1] <https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features#deprecated-features>

Closes GH-15583.
2024-09-01 17:19:37 +02:00
Christoph M. Becker
ac4039df20
Mark gd14930.phpt as dynamic xfail
This test only fails when `NAME_MAX` is defined, which is never the
case on Windows, so we let the test pass there.  This could be extended
to other environments where `NAME_MAX` is not defined.
2024-09-01 15:04:54 +02:00
Christoph M. Becker
a57ce052cd
Don't export php_pdo_int.h
This is, as the name and a comment in the header imply, an internal
header which is not supposed to be used by extensions other than PDO
(not even by drivers).

Since there is apparently no need to include this header in the parsers
of the drivers, we remove these includes, and no longer declare the
header to be installed.  Given that the header is only exported for a
couple of weeks[1], this is not considered to be a BC break, because
it's unlikely that external drivers have already been adjusted to use
this header, and otherwise they can still be fixed; PHP 8.4 is still in
the pre-release stage.

[1] <https://github.com/php/php-src/pull/14797>

Closes GH-15688.
2024-09-01 13:33:53 +02:00
Christoph M. Becker
0f8259e896
ICU 75.1 requires C++17 (GH-15678)
This needs to be explicitly enabled for MSVC (and probably clang on
Windows); otherwise the default is C++14, which is no longer sufficient
for ICU[1].

While the official PHP 8.4 builds for Windows do not yet use ICU 75.1,
that may change[2].  And even if not, it would be nice for custom
builds to be able to build against ICU 75.1 (or later).

Anyhow, using `std:c++17` is fine for ICU 72.1 which we are currently
using (and likely for some older ICU versions).

[1] <https://github.com/unicode-org/icu/releases/tag/release-75-1>
[2] <https://github.com/winlibs/icu4c/pulls>
2024-08-31 17:01:49 +02:00
Ayesh Karunaratne
a8df3d1eed
ext/curl: libcurl CURLOPT_{FTP_RESPONSE_TIMEOUT,ENCODING} replacements (#15126) 2024-08-31 14:26:11 +01:00
Niels Dossche
82c504fa9c
Fix GH-15670: Polymorphic cache slot issue in DOM (#15676)
A cache slot can be hit with different DOM object types, so we should
check if we're still handling the same type.
2024-08-31 12:13:21 +02:00
Niels Dossche
73b7993b0d
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15654: Signed integer overflow in ext/dom/nodelist.c
2024-08-31 11:56:34 +02:00
Niels Dossche
9cb23a3dec
Fix GH-15654: Signed integer overflow in ext/dom/nodelist.c
There's implicit truncation casts from zend_long to int which cause
issues because checks are done against the zend_longs. Since the
iterator infrastructure uses zend_longs, just convert everything to
zend_long.

Closes GH-15669.
2024-08-31 11:47:08 +02:00
Simonov Denis
eb3e7a2c0c
ext/pdo_firebird: Fixed GH-15604 Always make input parameters nullable (#15605)
Fixes #15604
Closes #15605
2024-08-31 17:06:41 +09:00
Go Kudo
bf9929a26c
standard: supress msan (#15665) 2024-08-31 15:56:11 +09:00
Peter Kokot
5ed1659039
Autotools: Fix pdo_mysql build with mysql client library (#15450)
When using --with-pdo-mysql=DIR and for some reason DIR wouldn't have
the executable DIR/bin/mysql_config available the 3rd option was so far
to guess the mysql client library locations and pass the include
directory further. The library directory and library name to link was
missing. This fixes this case for consistency reasons. And in the future
also the pkg-config could be a reliable alternative to mysql_config in
that case. The PDO_MYSQL_INC_DIR is already processed PHP_EVAL_INCLINE
so redundant PHP_ADD_INCLUDE is removed.
2024-08-31 02:35:34 +02:00
Peter Kokot
558ccf7362
Autotools: Add 3rd argument to dba PHP_TEMP_LDFLAGS
[skip ci]
2024-08-31 00:41:41 +02:00
Peter Kokot
b7db7708c3
Autotools: Refactor ODBC type checks (#15651)
- AS_VAR_IF macros used
- All check messages moved to the PHP_ARG_WITH 2nd argument and results
  simplified where possible (the ext_output variable and result message
  is done automatically when using PHP_ARG_* macros)
- Unusued ODBC_SHARED and ODBC_STATIC shell variables for DBMaker
  removed
- Help text for --with-unixodbc (and/or --with-unixODBC) configure
  option synced with current Autotools code. It is still possible to
  bypass the pkg-config search with optional DIR argument
2024-08-30 23:54:11 +02:00
David Carlier
fc01e2ee2b
Merge branch 'PHP-8.3' 2024-08-30 17:17:44 +01:00
David Carlier
d7d40b4c80
Merge branch 'PHP-8.2' into PHP-8.3 2024-08-30 17:17:20 +01:00
David Carlier
7db1a5843f
Fix GH-15653: fgetcsv overflow on length parameter.
close GH-15655
2024-08-30 17:16:57 +01:00
Saki Takamachi
a27878cff3
Fixed LONG_MAX in BCMath ext (#15663) 2024-08-31 01:07:33 +09:00
Arnaud Le Blanc
58aa6fc830
Lazy objects
RFC: https://wiki.php.net/rfc/lazy-objects

Closes GH-15019
2024-08-30 17:30:03 +02:00
Saki Takamachi
e8fe7e4f52
ext/bcmath: Fixed bcdiv() div by one (#15629)
Fixed the incorrect scale that should be used when dividing by 1, that is,
comparing the divisor and 1 to confirm equality.

Additionally, have increased the number of test cases for bcdiv_by_pow_10.phpt.
2024-08-30 09:33:17 +09:00
Peter Kokot
09d5b7102a
Fix -Wunused-function warning in ext/pdo_firebird (#15646)
When FB_API_VER equals to 30, for example, on Ubuntu, there is this
warning thrown with certain compiler configurations:

    /php-src/ext/pdo_firebird/pdo_firebird_utils.cpp:21:13: warning:
    ‘void fb_copy_status(const ISC_STATUS*, ISC_STATUS*, size_t)’
    defined but not used [-Wunused-function]
       21 | static void fb_copy_status(const ISC_STATUS* from, ISC_STATUS* to, size_t maxLength)
          |             ^~~~~~~~~~~~~~
2024-08-30 01:22:52 +02:00
Peter Kokot
7ebdd7d05a
Trim trailing whitespace (#15649)
[skip ci]
2024-08-30 01:20:56 +02:00
Peter Kokot
b3661701e1
Autotools: Sync CS in ext/dba (part 2) (#15621)
This is a follow-up of 4f6f4fb7d5

- PHP_DBA_DB_CHECK arguments quoted and normalized
- long lines reduced a bit
- Few additional AS_VAR_IF used
- Typo in variable name ${dbdp} fixed to ${dbdp4} as there is no dbdp
  variable anymore as of 4.x and 5.x paths checks
2024-08-30 00:59:44 +02:00
Peter Kokot
1b757c8d3c
Autotools: Replace backticks command substitutions with $(...) (#15639)
This is a follow-up of previous backticks replacement commits. This
replaces backticks command substitutions in remaining ext config M4
files, phpize, and configure.ac with the recommended $(...).

Note that $(...) still does not work on some obsolete shells that ship
with Solaris 10, for example. Elsewhere they should work. However, for
these obsolete shells Autoconf also re-executes the shell script under
the supported shell so it can make them work regardless.

Additionally, few comments CS are also adjusted to not cause confusion
when searching for backticks usages and one indentation sync done.

As of Autoconf 2.72 the backticks in macro help texts are also replaced
with single quotes.
2024-08-30 00:40:49 +02:00
David Carlier
307565d577
ext/gd: porting gdImageClone to the bundled libgd version.
close GH-15640
2024-08-29 23:13:20 +01:00
Dmitry Stogov
eb89233800
Merge branch 'PHP-8.3'
* PHP-8.3:
  Don't set IS_STR_PERMANENT flag for strings stored in the file cache (#15643)
2024-08-30 01:01:33 +03:00
Dmitry Stogov
b55816e9d1
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Don't set IS_STR_PERMANENT flag for strings stored in the file cache (#15643)
2024-08-30 01:01:22 +03:00
Dmitry Stogov
afba2010c0
Don't set IS_STR_PERMANENT flag for strings stored in the file cache (#15643) 2024-08-30 00:59:06 +03:00
Peter Kokot
0a6019a7d6
Autotools: Use SED variable for sed command (#15641)
This syncs sed usages across the build system as SED variable is set to
a suitable sed program on the system.
2024-08-29 23:46:04 +02:00
Dmitry Stogov
80efb3aba4
Merge branch 'PHP-8.3'
* PHP-8.3:
  Prevent possible incorrect optimization caused by ZEND_ASSUME()
2024-08-29 23:12:56 +03:00
Dmitry Stogov
bf98023f1a
Prevent possible incorrect optimization caused by ZEND_ASSUME() 2024-08-29 23:10:34 +03:00
Niels Dossche
367f303efa
Optimize DOM property access (#15626)
For the read and write implementation, store the handler pointer in the
first cache slot.
For the write implementation, use the second cache slot to store the
property info.

For a micro-benchmark that performs a write:
```php
$dom = new DOMDocument;
for ($i=0;$i<9999999;$i++)
        $dom->strictErrorChecking = false;
```

I obtain the following results on an i7-4790:

```
  ./sapi/cli/php ./write.php ran
    1.42 ± 0.08 times faster than ./sapi/cli/php_old ./write.php
```

For a micro-benchmark that performs a read:
```php
$dom = new DOMDocument;
for ($i=0;$i<9999999;$i++)
        $dom->strictErrorChecking;
```

I obtain the following results on the same machine:

```
  ./sapi/cli/php ./read.php ran
    1.29 ± 0.13 times faster than ./sapi/cli/php_old ./read.php
```
2024-08-29 20:13:29 +02:00
Dmitry Stogov
0268cb0343
Merge branch 'PHP-8.3'
* PHP-8.3:
  Restore error message incorrectly removed by commit 10d43c4 (related to GH-15497)
2024-08-29 17:00:43 +03:00
Dmitry Stogov
c15bb9afe2
Restore error message incorrectly removed by commit 10d43c4 (related to GH-15497) 2024-08-29 16:59:14 +03:00
Dmitry Stogov
45dac39c71
Prevent JIT of propery hooks in case of file caching (related to GH-15497) 2024-08-29 16:54:25 +03:00
Dmitry Stogov
17e313ee62
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15497: Opcache with file_cache and JIT enabled crashes (#15635)
2024-08-29 16:46:56 +03:00
Dmitry Stogov
fd42cdbd0a
Fix GH-15497: Opcache with file_cache and JIT enabled crashes (#15635) 2024-08-29 16:46:49 +03:00
Dmitry Stogov
d28b75f70d
Fix GH-15497: Opcache with file_cache and JIT enabled crashes (#15635) 2024-08-29 16:45:15 +03:00
Peter Kokot
7e1e450bb9
Autotools: Remove redundant double quotes (#15634) 2024-08-29 15:17:03 +02:00
Peter Kokot
8aaedbf96f
Autotools: Sync CS in ext/odbc (#15625)
- Obsolete backticks replaced with $(...); also backticks used inside
  AC_MSG_RESULT result in literal output. The $(...) works as intended
  and is executed in the shell with proper result message given
- A couple of AS_VAR_IF used
- Macro arguments quoted
- Added simplistic macro definitions headers as done with other php-src
  M4 headers for consistency of reading the code
2024-08-29 01:38:24 +02:00
Peter Kokot
fbacc0f936
Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +02:00
Máté Kocsis
09c498233e
Use ZEND_UNCOMPARABLE for consistency 2024-08-28 22:39:23 +02:00
Niels Dossche
51d93c1947 Remove failure paths for infallible code in simplexml
For IS_STRING, sxe_object_cast_ex() will call cast_object() which cannot
fail for IS_STRING.
2024-08-28 18:02:31 +02:00
Niels Dossche
9979f4748c Remove unused parameter from match_ns() 2024-08-28 18:02:31 +02:00
Niels Dossche
2fe8dd1054 Remove unused parameter of php_sxe_reset_iterator() 2024-08-28 18:02:31 +02:00
Niels Dossche
7f37c22d22 Cleanup php_sxe_count_elements_helper() 2024-08-28 18:02:31 +02:00
Peter Kokot
4f6f4fb7d5
Autotools: Sync CS in ext/dba (#15608)
- Macro headers synced with current PHP style (a minor description added
  and parameters)
- macro arguments quoted
- redundant double quotes reduces
- AS_VAR_IF macros used
- Redundant check message removed because there is already error thrown
  right after it
2024-08-28 14:52:24 +02:00
Peter Kokot
d9d49b2235
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix iconv_open basic test (#15611)
2024-08-28 14:31:43 +02:00
Peter Kokot
0f487e7d23
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix iconv_open basic test (#15611)
2024-08-28 14:31:24 +02:00
Peter Kokot
7878a2c322
Fix iconv_open basic test (#15611)
Transliteration works differently across the iconv implementations and
the system. When using GNU libiconv the output in this test is:
string(16) "Zlutouck'y kun\n"
(like on Windows). On glibc's built-in iconv output is:
string(15) "Zlutoucky kun\n"
2024-08-28 14:29:49 +02:00
Saki Takamachi
674ec02e54
Fixed the sign to be PLUS if the result is 0 (#15599) 2024-08-28 08:48:33 +09:00
Niels Dossche
9b73d591c6
Avoid string duplication if possible in SimpleXMLElement::addAttribute() (#15606) 2024-08-27 23:07:20 +02:00
Niels Dossche
067eb8c0d7
[ci skip] Remove confusing comments
They are readonly / not readonly depending on the class where they're used.
However, the comment makes this confusing [1].

[1] https://github.com/php/php-src/issues/15578#issuecomment-2310389300
2024-08-27 22:24:39 +02:00
Niels Dossche
88393cfaf7
Fix GH-13988: Storing DOMElement consume 4 times more memory in PHP 8.1 than in PHP 8.0
We avoid creating backing storage by using the feature introduced in
f78d5cfcd2.

Closes GH-15593.
2024-08-27 20:14:25 +02:00
Dmitry Stogov
16d4fb19a9
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15502: Crash with JIT and Excimer (#15601)
2024-08-27 21:12:53 +03:00
Dmitry Stogov
12b854f91b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15502: Crash with JIT and Excimer (#15601)
2024-08-27 21:12:43 +03:00
Dmitry Stogov
eb87de1c87
Fix GH-15502: Crash with JIT and Excimer (#15601) 2024-08-27 21:12:29 +03:00
Dmitry Stogov
f0f1724fb9
Remove unintended ZEND_EXT_API usage (#15602) 2024-08-27 21:11:54 +03:00
David Carlier
c4ae645849
Follow-up on GH-15548: curl_multi_select.
throws a ValueError on timeout overflow.

close GH-15594
2024-08-27 17:05:55 +01:00
Simonov Denis
8487ddb8a3
pdo_firebird: Cleanup code (GH-15510)
Since we're requiring fbclient >= 3.0 anyway, we:

* Remove unneeded `#if FB_API_VER >= 25`, `#if FB_API_VER >= 30`,
  `#ifdef SQL_BOOLEAN`

* Simplify support for new types for query input parameters.
  Support force_null for them.

* fbclient 3.0+ does not have a limit on the length of a SQL query of 64 KB.
  The new limit is 10 MB, no one in their right mind would transmit a query of such length.
2024-08-27 11:35:04 +02:00
David Carlier
f7186a06e5
Merge branch 'PHP-8.3' 2024-08-27 04:57:45 +01:00
David Carlier
618edb5e15
Merge branch 'PHP-8.2' into PHP-8.3 2024-08-27 04:57:13 +01:00
David Carlier
cc67220ea3
Fixed GH-15547: curl_multi_wait expects a signed int for timeout.
confusion might come from the previous argument type.
PHP expects ms so we check it fits integer boundaries before the cast.
raising a warning at least for stable branches.

close GH-15548
2024-08-27 04:56:32 +01:00
Ilija Tovilo
8df557ac42
[RFC] Asymmetric visibility v2 (GH-15063)
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2024-08-27 02:04:48 +02:00
Peter Kokot
fef55bc8e4
Autotools: Fix tidy library checks (#15576)
When configuring with tidy library installed in non-standard paths, the
library adding macro must be done before the PHP_CHECK_LIBRARY to be
able to detect it. This fixes these edge cases. For example:

    ./configure --with-tidy=/path/to/custom-tidy-installation
2024-08-27 00:00:20 +02:00
Niels Dossche
baac01f594 Improve virtual property error message
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-08-26 21:17:49 +02:00
Niels Dossche
6c63c48a7e Use virtual annotation in XMLReader
All properties of XMLReader are virtual and therefore don't need backing
storage.
2024-08-26 21:17:49 +02:00
Niels Dossche
f78d5cfcd2 Allow ZEND_ACC_VIRTUAL to be used to not have property backing storage without resorting to hooks
This is useful to reduce the memory usage of objects that don't actually
use the backing storage. Examples are XMLReader and DOM. When the
properties were added to the stubs, these objects became much much
bigger, which is a waste of memory.

Closes GH-11644.

Work towards GH-13988.
2024-08-26 21:17:49 +02:00
Ilija Tovilo
606eb849bb
Stop recording of trace when encountering hook
Fixes GH-15178
2024-08-26 17:27:50 +02:00
Ilija Tovilo
b839c5f1af
Fix building of callgraph including preloaded symbols (GH-15545)
This issue was introduced in GH-15021. When building the call graph, we can now
see preloaded functions. However, building the call graph involves adding the
function to the caller list of the callee, which we don't want to do for
functions not coming from the script.

Fixes GH-15490
2024-08-26 17:22:04 +02:00
Florian Engelhardt
b9b317afd4
Export opcache shared globals (#15543) 2024-08-26 14:54:36 +02:00
Ayesh Karunaratne
a3b7cc2217
ext/curl: Add CURLOPT_PREREQFUNCTION (#13255)
Curl >= 7.80.0 supports declaring a function for `CURLOPT_PREREQFUNCTION` option
that gets called after Curl establishes a connection (including the TLS handshake
for HTTPS connections), but before the actual request is made.

The callable must return either `CURL_PREREQFUNC_OK` or `CURL_PREREQFUNC_ABORT` to
allow or abort the request.

This adds support for it to PHP with required ifdef.

 - libc: https://curl.se/libcurl/c/CURLOPT_PREREQFUNCTION.html

Co-authored-by: Gina Peter Bnayard <girgias@php.net>
2024-08-26 13:33:16 +01:00
^_^
555b603d23
mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT (#13618) 2024-08-26 12:52:26 +09:00
Peter Kokot
fefa7d8c07
Autotools: Sync CS in ext/phar (#15586) 2024-08-25 17:26:21 +02:00
Peter Kokot
f88e32d4b5
Autotools: Simplify adding tidy cflags (#15577) 2024-08-25 17:25:54 +02:00