Commit Graph

67639 Commits

Author SHA1 Message Date
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