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

136923 Commits

Author SHA1 Message Date
Niels Dossche
2d029efd94 Avoid duplicating the filename string when profiling in XSL (#15010) 2024-07-18 17:27:53 +02:00
Niels Dossche
a59103feed Fix trampoline leak in xpath callables
Closes GH-15009.
2024-07-18 16:54:46 +02:00
Niels Dossche
5471f3d922 Don't open-code string value accesses in xpath (#15007) 2024-07-18 15:22:44 +02:00
Gina Peter Banyard
efe4e6d38e ext/spl: Add ArrayObject test with property hooks (#15005)
As expected, ArrayObject is cursed
2024-07-18 13:10:00 +01:00
Niels Dossche
b05de66a3a Optimize ext/dom $wholeText (#15001)
Use our own string builder instead of using libxml's and then having to
copy over.

For the following test:
```
$dom = Dom\HTMLDocument::createEmpty();
$root = $dom->appendChild($dom->createElement('root'));
$root->append('abc', 'def', 'ghi');
$f = $root->firstChild;

for ($i = 0; $i < 1000000; $i++)
	$f->wholeText;
```

The following results were obtained on an i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
  Time (mean ± σ):      57.2 ms ±   2.3 ms    [User: 53.2 ms, System: 3.4 ms]
  Range (min … max):    54.7 ms …  69.3 ms    52 runs

Benchmark 2: ./sapi/cli/php_old x.php
  Time (mean ± σ):      89.4 ms ±   3.4 ms    [User: 85.6 ms, System: 3.0 ms]
  Range (min … max):    86.1 ms … 105.8 ms    32 runs

Summary
  ./sapi/cli/php x.php ran
    1.56 ± 0.09 times faster than ./sapi/cli/php_old x.php
```
2024-07-18 12:57:23 +02:00
Christoph M. Becker
2d88427bc7 Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert "Skip bug45161.phpt on Windows"
2024-07-18 12:44:27 +02:00
Christoph M. Becker
fc93300407 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Skip bug45161.phpt on Windows"
2024-07-18 12:43:35 +02:00
Christoph M. Becker
355baf982e Revert "Skip bug45161.phpt on Windows"
This reverts commit 4b22c3e3ad.

As quick measure for GH-10753, that test was skipped on Windows.
However, it seems that there are no longer performance issues with
newer cURL versions, so we run that test again on Windows.

Fixes GH-10753.
Closes GH-14998.
2024-07-18 12:42:01 +02:00
Christoph M. Becker
f507da913a [ci skip] Clarify usage of C99 standard (#14993)
This is mostly about mentioning that VLAs which are a required part of
C99 conforming implementations (although made optional in the C11
standard) *must* *not* be used in php-src.
2024-07-18 11:40:58 +02:00
David Carlier
223683dfb5 Merge branch 'PHP-8.3' 2024-07-18 06:26:54 +01:00
David Carlier
383d1b0330 Merge branch 'PHP-8.2' into PHP-8.3 2024-07-18 06:26:22 +01:00
David Carlier
efd00b8ff0 ext/curl: curl_error using curl_easy_strerror if CURLOPT_ERRORBUFFER
did not fill the error buffer.

close GH-14984
2024-07-18 06:25:37 +01:00
Saki Takamachi
c550d341ff ext/pdo_firebird: Added getApiVersion() and removed from getAttribute (#15004) 2024-07-18 11:17:52 +09:00
Saki Takamachi
4cb82b039e ext/pdo_firebird: Do not implement new constants in PDO core (#14995) 2024-07-18 08:12:17 +09:00
Niels Dossche
b3a4a6b1e1 Resolve TODOs in ext/dom around nullable content (#14999)
It's indeed possible this is NULL. When you create a new text-like node
in libxml and pass NULL as content, you do get NULL in the content field
instead of the empty string. You can hit this by creating DOMText or
DOMComment directly and not passing any argument. This could also be
created internally.
We refactor the code such that this detail is hidden and we add a test
to check that it correctly throws an exception.
2024-07-18 00:05:40 +02:00
David CARLIER
8d597150ee zend build making sigjmp_buf and api check as mandatory. (#14942)
* zend build making sigjmp_buf and api check as mandatory.

all unixes support it since long time, the few which don't do not meet
the requirements to build php anyway (minix, dietlibc, ...).
2024-07-17 22:18:35 +01:00
Niels Dossche
1b077725eb [ci skip] Remove outdated comment 2024-07-17 22:27:09 +02:00
Niels Dossche
7d99a9cea1 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix bug #55639: Digest autentication dont work
2024-07-17 19:35:19 +02:00
Niels Dossche
d3caedd6d2 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug #55639: Digest autentication dont work
2024-07-17 19:31:54 +02:00
Niels Dossche
911dc5b46c Fix bug #55639: Digest autentication dont work
RFC 2617 and 7616 describe that for the "Authorization" header we should
not put the qop nor nc value inside quotes. This differs from the
WWW-Authenticate header, which may have been the source of the confusion
in the implementation. While the version with quotes seems to work fine
in some cases, clearly not all servers accept the non-standard form.
To fix the issue, simply removing the quotes of those two header fields
of the client request to be in line with the RFC suffices.

I refer further to example 3.5 in RFC 2617 and example 3.9.1 in
RFC 7616.

RFC 2617: https://datatracker.ietf.org/doc/html/rfc2617
RFC 7616: https://datatracker.ietf.org/doc/html/rfc7616

Closes GH-14328.
2024-07-17 19:23:10 +02:00
Sergey Panteleev
0caaeb68cf [ci skip] Update release process for pre-GA (#14988) 2024-07-17 17:55:03 +03:00
Peter Kokot
cf1835b8b6 Autotools: Fix Autoconf syntax (erroneous dnl) (#14987)
M4 interprets the dnl in this combination of m4_ifnblank as part of the
preceding text so the [] can be used to avoid this issue.
2024-07-17 15:47:20 +02:00
David CARLIER
2aeff2c988 main: update Winsock api version to 2.2 (#14909)
not been updated since php 4 whereas 2.2 is available even in Win2000.
2024-07-17 14:17:29 +01:00
Saki Takamachi
3c9ab6eb71 ext/bcmath: Moved macros and added a test 2024-07-17 21:48:16 +09:00
Saki Takamachi
acd6ac3324 Fixed parent class of stub (#14990) 2024-07-17 21:38:59 +09:00
Saki Takamachi
d55ef3f339 ext/pdo_firebird: Added Pdo\Firebird::ATTR_API_VERSION (#14916)
closes #14916
2024-07-17 20:32:37 +09:00
Niels Dossche
b2c3f2fead Delete bug78987.phpt test (#14982)
This test fails over and over again every time we update the library or
because of small changes elsewhere. This leads to a cycle of test
failures and us bumping the values again. This test has little value so
I propose to just get rid of it.

Fixes GH-13795.
2024-07-17 12:59:17 +02:00
Christoph M. Becker
f590b34530 Drop support for OpenSSL < 1.1.0 on Windows
PR #13498 bumped the required OpenSSL version to 1.1.1, but apparently
only for non Windows system.  We catch up somewhat by dropping support
for OpenSSL < 1.1.0 on Windows; besides completely removing detection
of old OpenSSL versions in `SETUP_OPENSSL`, we also ensure that all
bundled extension using this function do no longer accept OpenSSL <
1.1.0, to avoid to still be able to build these extensions with older
`phpize` scripts.

We do not cater to `--phar-native-ssl` yet; that might better be
addressed by #14578.

Closes GH-14973.
2024-07-17 12:22:59 +02:00
Ilija Tovilo
ead679ecf8 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix comments between -> and keyword
2024-07-16 23:41:07 +02:00
Ilija Tovilo
e01e2bb5fd Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix comments between -> and keyword
2024-07-16 23:40:59 +02:00
Ilija Tovilo
b368db204f Fix comments between -> and keyword
Comments should not fall out of ST_LOOKING_FOR_PROPERTY.

Fixes GH-14961
Closes GH-14976
2024-07-16 23:40:18 +02:00
Ilija Tovilo
fdbe910b3b Fix indirect readonly error messages (#14979)
$obj->ro[] = 42;, passByRef($obj->ro); and the likes should emit an indirect
modification error message. This message already existed but was used
inconsistently.
2024-07-16 23:24:07 +02:00
Peter Kokot
71c520c74f Fix xmlreader extension phpize build
When building ext/xmlreader with phpize, also ext/dom/dom_ce.h needs to
be installed by dom extension as it is used in
the ext/xmlreader/php_xmlreader.c.

    cd ext/xmlreader
    phpize
    ./configure
    make

Closes GH-14978
2024-07-16 22:35:59 +02:00
Niels Dossche
eb181926be [ci skip] Fix NEWS 2024-07-16 22:25:41 +02:00
Niels Dossche
251b7896ff Use fast ZPP for ParentNode manipulation methods (#14981)
These are very common, and parsing variadic arguments takes a very long
time, so this optimization makes sense to do.
2024-07-16 20:36:24 +02:00
Niels Dossche
f58a3c392f Fix references in request_parse_body() options array
Otherwise we get funny messages like
"Invalid string value in $options argument".

Closes GH-14977.
2024-07-16 20:07:59 +02:00
Saki Takamachi
c4f1c5cd9f Updated firebird version in windows ci (#14912) 2024-07-16 19:56:14 +02:00
Julien Voisin
ae2abcf3e8 Add a check for required extensions in benchmark.php (#14811)
This should prevent people from being disappointed by
an unexpected error message when running the benchmark,
namely:

```
jvoisin@chernabog 21:54 (master) ~/dev/php-src php ./benchmark/benchmark.php false sapi/cgi/php-cgi
> 'valgrind' '--tool=callgrind' '--dump-instr=yes' '--callgrind-out-file=/home/jvoisin/dev/php-src/benchmark/profiles/callgrind.out.bench' '--' 'sapi/cgi/php-cgi' '-T1' '-d max_execution_time=0' '-d opcache.enable=1' '-d opcache.jit=disable' '-d opcache.jit_buffer_size=128M' '-d opcache.validate_timestamps=0' '/home/jvoisin/dev/php-src/Zend/bench.php'
> 'valgrind' '--tool=callgrind' '--dump-instr=yes' '--callgrind-out-file=/home/jvoisin/dev/php-src/benchmark/profiles/callgrind.out.bench.jit' '--' 'sapi/cgi/php-cgi' '-T1' '-d max_execution_time=0' '-d opcache.enable=1' '-d opcache.jit=tracing' '-d opcache.jit_buffer_size=128M' '-d opcache.validate_timestamps=0' '/home/jvoisin/dev/php-src/Zend/bench.php'
> '/usr/bin/php' '/home/jvoisin/dev/php-src/benchmark/repos/symfony-demo-2.2.3/bin/console' 'cache:clear'
> '/usr/bin/php' '/home/jvoisin/dev/php-src/benchmark/repos/symfony-demo-2.2.3/bin/console' 'cache:warmup'
> 'valgrind' '--tool=callgrind' '--dump-instr=yes' '--callgrind-out-file=/home/jvoisin/dev/php-src/benchmark/profiles/callgrind.out.symfony-demo' '--' 'sapi/cgi/php-cgi' '-T50,50' '-d max_execution_time=0' '-d opcache.enable=1' '-d opcache.jit=disable' '-d opcache.jit_buffer_size=128M' '-d opcache.validate_timestamps=0' '/home/jvoisin/dev/php-src/benchmark/repos/symfony-demo-2.2.3/public/index.php'
PHP Fatal error:  Uncaught Error: Call to undefined function gmp_strval() in /home/jvoisin/dev/php-src/benchmark/benchmark.php:128
Stack trace:
  thrown in /home/jvoisin/dev/php-src/benchmark/benchmark.php on line 128
[255]
jvoisin@chernabog 12:05 (master) ~/dev/php-src
```
2024-07-16 19:37:20 +02:00
Pierrick Charron
f0dc7ad5ce Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Fix PHP 8.3.10 release date and version in NEWS
  PHP-8.2 is now for PHP 8.2.23-dev
2024-07-16 12:24:03 -04:00
Pierrick Charron
c21cfa1135 [skip ci] Fix PHP 8.3.10 release date and version in NEWS 2024-07-16 12:23:31 -04:00
Pierrick Charron
e7e09c80f8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.23-dev
2024-07-16 12:21:30 -04:00
Pierrick Charron
e07813ad46 PHP-8.2 is now for PHP 8.2.23-dev 2024-07-16 12:20:55 -04:00
Ilija Tovilo
a26ec58fa1 De-duplicate readonly property modification error message (#14972) 2024-07-16 16:29:40 +02:00
Tim Düsterhus
551038bb16 zend_compile: Fully remove ZEND_DIM_ALTERNATIVE_SYNTAX (#14974)
This flag is longer set since the merge of property hooks in
780a8280d2. This patch removes it completely,
because the corresponding error messages are unreachable.
2024-07-16 16:27:46 +02:00
Eric Mann
a4c867e8cf Merge branch 'PHP-8.3' 2024-07-16 06:58:03 -07:00
Eric Mann
155e89e12f PHP-8.3 is now for PHP 8.3.11-dev 2024-07-16 06:45:20 -07:00
Ayesh Karunaratne
e7c16d2a6a Build/Windows: Update the Windows icon as svg and build derivatives from it
Co-Authored-By: Nurudin Imsirovic <realnurudinimsirovic@gmail.com>

Closes GH-14964.
2024-07-16 14:47:31 +02:00
Ilija Tovilo
aa006f1cf6 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix use-after-free in property coercion with __toString()
2024-07-16 12:44:01 +02:00
Ilija Tovilo
aca2322801 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix use-after-free in property coercion with __toString()
2024-07-16 12:43:29 +02:00
Ilija Tovilo
8c312ba74b Fix use-after-free in property coercion with __toString()
This was only partially fixed in PHP-8.3. Backports and fixes the case for both
initialized and uninitialized property writes.

Fixes GH-14969
Closes GH-14971
2024-07-16 12:40:14 +02:00