Commit Graph

136439 Commits

Author SHA1 Message Date
Máté Kocsis
c588db1ee7
Use RETURN_THROWS() for WeakMap methods 2024-06-18 22:34:18 +02:00
Matteo Beccati
fbe317bf21
Merge remote-tracking branch 'mbeccati/pdo_driver_specific_parser' 2024-06-18 17:07:14 +02:00
Sergey Panteleev
f4588d55a2
Merge branch 'refs/heads/PHP-8.3'
* refs/heads/PHP-8.3:
  PHP-8.2 is now for PHP 8.2.22-dev
2024-06-18 17:56:49 +03:00
Sergey Panteleev
70861c82df
Merge branch 'refs/heads/PHP-8.2' into PHP-8.3
* refs/heads/PHP-8.2:
  PHP-8.2 is now for PHP 8.2.22-dev

# Conflicts:
#	Zend/zend.h
#	configure.ac
#	main/php_version.h
2024-06-18 17:56:30 +03:00
Sergey Panteleev
49aaa7cd9f
PHP-8.2 is now for PHP 8.2.22-dev 2024-06-18 17:56:05 +03:00
Matteo Beccati
329dfa7e0e
[ci skip] Updated NEWS and UPGRADING 2024-06-17 23:58:09 +02:00
Matteo Beccati
53d7c17474
pdo_pgsql: escaped question marks inside dollar quoted strings
Allow "??" in dollar quoted strings for backwards compatibility,
as it was a viable workaround to insert question marks without them
being parsed as placeholders.

Add a deprecation notice to tell that the escape is no longer
necessary within dollar quotes and that its usage is deprecated.

Ref bug #14244
2024-06-17 23:31:25 +02:00
Matteo Beccati
037243ccd7
pdo_mysql: "--" should be followed by a whitespace character
This required changing how YYFILL works, with no apparent regressions
2024-06-17 23:31:25 +02:00
Matteo Beccati
3096ffa7ab
pdo_sqlite: identifier quoting with square brakets 2024-06-17 23:31:24 +02:00
Matteo Beccati
01879ec254
pdo_pgsql: add support for dollar-quotes
RFC: http://wiki.php.net/rfc/pdo_driver_specific_parsers
2024-06-17 23:31:24 +02:00
Matteo Beccati
e82c486918
pdo_pgsql: add support for "escape" string literals
RFC: http://wiki.php.net/rfc/pdo_driver_specific_parsers
2024-06-17 23:31:24 +02:00
Matteo Beccati
715b9aaa09
Implemented PDO Driver specific SQL parsers
RFC: http://wiki.php.net/rfc/pdo_driver_specific_parsers
2024-06-17 23:31:24 +02:00
David Carlier
ac947925c0
Merge branch 'PHP-8.3' 2024-06-17 17:46:54 +01:00
David Carlier
8690d522a3
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-17 17:46:24 +01:00
David Carlier
03f0776d08
Fix GH-13681: segfault when adding watchpoint fails.
thus when removing its entry, no watch point is set and crash on
pointer access.

close GH-14513
2024-06-17 17:45:53 +01:00
Tim Düsterhus
9907389007
Fix sprintf_rope_optimization_004.phpt for 32-bit versions
see 2c5ed50d5c
2024-06-17 17:45:46 +02:00
Tim Düsterhus
2c5ed50d5c
zend_compile: Add support for %d to sprintf() optimization (#14561)
* zend_compile: Rename `string_placeholder_count` to `placeholder_count` in `zend_compile_func_sprintf()`

This is intended to make the diff of a follow-up commit smaller.

* zend_compile: Add support for `%d` to `sprintf()` optimization

This extends the existing `sprintf()` optimization by support for the `%d`
placeholder, which effectively equivalent to an `(int)` cast followed by a
`(string)` cast.

For a synthetic test using:

    <?php

    $a = 'foo';
    $b = 42;

    for ($i = 0; $i < 100_000_000; $i++) {
        sprintf("%s-%d", $a, $b);
    }

This optimization yields a 1.3× performance improvement:

    $ hyperfine 'sapi/cli/php -d zend_extension=php-src/modules/opcache.so -d opcache.enable_cli=1 test.php' \
          '/tmp/unoptimized -d zend_extension=php-src/modules/opcache.so -d opcache.enable_cli=1 test.php'
    Benchmark 1: sapi/cli/php -d zend_extension=php-src/modules/opcache.so -d opcache.enable_cli=1 test.php
      Time (mean ± σ):      3.296 s ±  0.094 s    [User: 3.287 s, System: 0.005 s]
      Range (min … max):    3.213 s …  3.527 s    10 runs

    Benchmark 2: /tmp/unoptimized -d zend_extension=php-src/modules/opcache.so -d opcache.enable_cli=1 test.php
      Time (mean ± σ):      4.300 s ±  0.025 s    [User: 4.290 s, System: 0.007 s]
      Range (min … max):    4.266 s …  4.334 s    10 runs

    Summary
      sapi/cli/php -d zend_extension=php-src/modules/opcache.so -d opcache.enable_cli=1 test.php ran
        1.30 ± 0.04 times faster than /tmp/unoptimized -d zend_extension=php-src/modules/opcache.so -d opcache.enable_cli=1 test.php

* Fix sprintf_rope_optimization_003.phpt test expecation for 32-bit integers

* zend_compile: Indent switch-case labels in zend_compile_func_sprintf()

* Add GMP test to sprintf() rope optimization

* Add `%s` test case to sprintf() GMP test
2024-06-17 17:07:50 +02:00
Peter Kokot
9d3907fd85
Fix RAND_egd check (#14588)
When building with OpenSSL (--with-openssl) the OpenSSL libraries
(crypto and ssl) are added to LIBS. When building --with-openssl=shared
the libraries are added to OPENSSL_SHARED_LIBADD. This fixes the check
for the shared build when OpenSSL is built with RAND_egd support.
2024-06-17 13:02:53 +02:00
Dmitry Stogov
1f48715798
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558)
2024-06-17 09:38:17 +03:00
Dmitry Stogov
e842ddfe4f
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558)
2024-06-17 09:38:02 +03:00
Dmitry Stogov
350af549a0
Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558) 2024-06-17 09:37:44 +03:00
David CARLIER
1fc083e526
ext/gd: iamgeresolution checks overflow. (#14585) 2024-06-16 23:28:04 +01:00
Gina Peter Banyard
a888c4f0ff
Merge branch 'PHP-8.3'
* PHP-8.3:
  ext/soap: Fix memory leaks when calling SoapFault::__construct() twice
2024-06-16 23:01:52 +01:00
Gina Peter Banyard
e9b36438ed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/soap: Fix memory leaks when calling SoapFault::__construct() twice
2024-06-16 23:01:36 +01:00
Gina Peter Banyard
df219ccf9d
ext/soap: Fix memory leaks when calling SoapFault::__construct() twice 2024-06-16 23:00:59 +01:00
Jakub Zelenka
7c32704a71
Fix GH-14474: Better document remote user in PHP-FPM access.format (#14521) 2024-06-16 12:32:00 +01:00
Jakub Zelenka
c33f58867e
Merge branch 'PHP-8.3' 2024-06-16 12:24:25 +01:00
Jakub Zelenka
ea79560190
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-16 12:23:15 +01:00
Wilhansen Li
43bc53a730
Fix GH-14037: Make /ping of php-fpm work with pm.status_listen pool
The ping feature of php-fpm monitoring was previously not working
in pm.status_listen pool due to the configuration variables ping.path
and ping.response not being copied over to the worker when forked. This
results in the ping code path being disabled because the worker detects
that ping.path is not configured.

Closes GH-13980

Co-authored-by: Pierrick Charron <pierrick@php.net>
2024-06-16 12:22:21 +01:00
Peter Kokot
a6b5439e2e
Fix warnings function declaration isn't a prototype (#14577)
This fixes the -Wstrict-prototypes warnings that might pop up in certain
builds.
2024-06-15 21:27:56 +02:00
David Carlier
564914ac1a
ext/pgsql: adding postgresql 17 new libpq wrapper call.
pg_set_chunked_rows_size to allow to fetch results in chunk of max N rows.

close GH-14571
2024-06-15 19:56:15 +01:00
Peter Kokot
12f9b89bc5
Remove redundant win32 include flag for apache2handler (#14576) 2024-06-15 17:45:00 +02:00
Peter Kokot
ca5952a98a
Refactor SHADOW_STACK_SYSCALL check (#14575)
This fixes -Wundef warnings present where SHADOW_STACK_SYSCALL should
be defined to value 0 and refactors the check with cache variable
php_cv_have_shadow_stack_syscall. The SHADOW_STACK_SYSCALL CPP macro
definition is removed from php_config.h in favor of a compilation
definition on asm files and Zend engine files.
2024-06-15 17:00:56 +02:00
Peter Kokot
dd4e2ef5b0
Update ext/xmlreader dependencies (#14572)
- ext/dom is optional (using HAVE_DOM for cases when dom is build as
  a shared extension to make it required in that case)
- ext/libxml is required
2024-06-15 16:25:26 +02:00
Bob Weinand
6a2c5318f9
Optimize observers (#13649)
Inline the lookup whether a function is observed at all.
This strategy is also used for FRAMELESS calls. If the frameless call is observed, we instead allocate a call frame and push the arguments, to call the the function afterwards.
Doing so is still a performance benefit as opposed to executing individual INIT_FCALL+SEND_VAL ops. Thus, even if the frameless call turns out to be observed, the call overhead is slightly lower than before.
If the internal function is not observed at all, the unavoidable overhead is fetching the FLF zend_function pointer and the run-time cache needs to be inspected.

As part of this work, it turned out to be most viable to put the result operand on the ZEND_OP_DATA instead of ZEND_FRAMELESS_ICALL_3, allowing seamless interoperability with the DO_ICALL opcode.
This is a bit unusual in comparison to all other ZEND_OP_DATA usages, but seems to not pose problems overall.

There is also a small issue resolved: trampolines would always use the ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER function due to zend_observer_fcall_op_array_extension being set to -1 too late.
2024-06-15 14:42:27 +02:00
Peter Kokot
6e825dfe43
Add --enable-phpdbg-debug option on Windows (#14568)
This enables outputting additional debugging messages when running
phpdbg for developing and troubleshooting phpdbg itself. Option was
already added in Autotools and this adds it also to Windows build
system.

Because additional info is printed when running tests, the
--enable-phpdbg-debug option is excluded when building with
--enable-snapshot-build if not provided explicitly.
2024-06-15 14:41:15 +02:00
Peter Kokot
e3f10732a8
Remove redundant win32 include flag when building shared phpdbg (#14573) 2024-06-15 13:17:45 +02:00
Gina Peter Banyard
f0fb9e34a5 ext/spl: use ecalloc instead of complicate memset to 0 2024-06-15 01:33:09 +01:00
Gina Peter Banyard
5337172508 ext/spl: Use ArrayObject object handlers for ArrayIterator
They are the same
2024-06-15 01:33:09 +01:00
Gina Peter Banyard
446b7fbab9 ext/spl: Remove unused typedef 2024-06-15 01:33:09 +01:00
Gina Peter Banyard
809410423f ext/spl: Refactor debug handlers
Mainly to use zend_mangle_property_name() directly instead of spl_gen_private_prop_name()
2024-06-15 01:33:09 +01:00
Gina Peter Banyard
54047c1090 ext/spl: Remove some useless header includes and clarify usages 2024-06-15 01:33:09 +01:00
Gina Peter Banyard
3fd60d33ca ext/spl: Refactor SplFileObject::fgetc() 2024-06-15 01:33:09 +01:00
Gina Peter Banyard
f296cba58c ext/spl: Convert current_line to a zend_string* 2024-06-15 01:33:09 +01:00
Gina Peter Banyard
bb4491af88 ext/spl: Adding a const modifier 2024-06-15 01:33:09 +01:00
Gina Peter Banyard
35c5cf9760 ext/spl: Remove useless wrapper 2024-06-15 01:33:09 +01:00
Gina Peter Banyard
90b8db49ac ext/spl: Refactor SplFileInfo::getPathInfo() implementation 2024-06-15 01:33:09 +01:00
Máté Kocsis
bed11e4edc
Generate DocBook 5.2 conformant class synopses pages (#14351)
Related to https://github.com/php/doc-en/pull/3415
2024-06-14 22:12:40 +02:00
David Carlier
2bb8fbd0a8
ext/pgsql: add pg_jit server info.
since PostgreSQL 11, LLVM JIT feature had been brought thus reporting
the settings to the client connection.

Close GH-14566
2024-06-14 16:27:00 +01:00
Niels Dossche
4107cb2eda phpdbg: change uses of sprintf into snprintf 2024-06-14 08:12:03 -07:00