Commit graph

133242 commits

Author SHA1 Message Date
Niels Dossche
0ea268b51a Remove obsolete libxml2 code
LIBXML2_NEW_BUFFER is always defined since libxml2 2.9.0.
That's the minimum version PHP requires, so it will always be defined.
2023-09-09 21:58:13 +02:00
Niels Dossche
518233c39d Merge branch 'PHP-8.3'
* PHP-8.3:
  Use zend_get_gc_buffer_add_fcc()
2023-09-09 20:00:18 +02:00
Niels Dossche
49980ee89d Use zend_get_gc_buffer_add_fcc() 2023-09-09 20:00:01 +02:00
Niels Dossche
c7777e354d Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix build with sqlite3 gc and fci/fcc api
2023-09-09 16:07:17 +02:00
Niels Dossche
1d59b37742 Fix build with sqlite3 gc and fci/fcc api 2023-09-09 16:07:10 +02:00
Niels Dossche
c8e2765ba3 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:35:11 +02:00
Niels Dossche
cb6fac5b8a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:35:03 +02:00
Niels Dossche
6851c7b867 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
2023-09-09 15:34:38 +02:00
Niels Dossche
07a9d2fb32 Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
In this test file, the free_obj handler is called with a refcount of 2,
caused by the fact we do a GC_ADDREF() to increase its refcount while
its refcount is still 1 because the Foo object hasn't been destroyed yet
(due to the cycle caused by the sqlite function callback).
Solve this by introducing a get_gc handler.

Closes GH-11881.
2023-09-09 15:33:50 +02:00
David Carlier
aef5225394 zend_call_stack_get implementation for NetBSD.
Despite being OpenBSD's predecessor, the approach is in fact
a lot closer to Linux, at least in principle. We purposely
avoid reading /proc/N/maps to be more future-proof.

Close GH-11637
2023-09-09 13:48:40 +01:00
Niels Dossche
880faa39e8
Add DOMNode::compareDocumentPosition() (#12146)
Reference: https://dom.spec.whatwg.org/#dom-node-comparedocumentposition
2023-09-09 01:14:26 +02:00
Niels Dossche
8c2c69494e Replace always-false attribute type check with assertion
The type will always be XML_ATTRIBUTE_NODE by construction via
php_dom_create_object, no need to check the type. Use an assertion
instead. This simplifies code and reasoning about error conditions.
2023-09-08 22:51:22 +02:00
Alex Dowad
50ca24251d PHP_HAVE_BUILTIN_USUB_OVERFLOW macro is defined even if __builtin_usub_overflow not available
...So conditionally including code which uses __builtin_usub_overflow
(for performance) if the macro is defined is not correct. We also need
to check if the macro is defined as a non-zero value.

Apparently this broke the build for a user whose C compiler is GCC
4.9.4. Sorry, user! That was my fault!

Thanks to Jakub Zelenka for reporting the issue.
2023-09-08 20:36:24 +02:00
Dmitry Stogov
be87cf9e62 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fixed tracing JIT support for CALLABLE_CONVERT (#12156)
2023-09-08 18:27:54 +03:00
Dmitry Stogov
94eb3bdcbf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed tracing JIT support for CALLABLE_CONVERT (#12156)
2023-09-08 18:27:44 +03:00
Dmitry Stogov
8fcffa666f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed tracing JIT support for CALLABLE_CONVERT (#12156)
2023-09-08 18:27:31 +03:00
Dmitry Stogov
be0245c756
Fixed tracing JIT support for CALLABLE_CONVERT (#12156) 2023-09-08 18:27:13 +03:00
Niels Dossche
d639a3755a Merge branch 'PHP-8.3'
* PHP-8.3:
  Update bundled pcre2 to 10.42
2023-09-08 17:15:56 +02:00
Niels Dossche
c4e8f652c5 Update bundled pcre2 to 10.42
Closes GH-12109.
2023-09-08 17:14:39 +02:00
Niels Dossche
ac62eee842
Remove DOM_NO_ARGS() and DOM_NOT_IMPLEMENTED() (#12147)
DOM_NO_ARGS() has no users.
DOM_NOT_IMPLEMENTED() has a single user.
2023-09-08 17:02:52 +02:00
George Peter Banyard
8f8f31a16a
Merge branch 'PHP-8.3'
* PHP-8.3:
  streams: Checking if a stream is castable should not emit warnings for user defined streams
2023-09-08 13:23:20 +01:00
George Peter Banyard
d68073c23b
streams: Checking if a stream is castable should not emit warnings for user defined streams
Closes GH-10435
2023-09-08 13:22:43 +01:00
George Peter Banyard
7723718502
ext/pdo: Refactor pdo_stmt_construct() to use newer FCI/FCC API (#12142) 2023-09-08 12:32:44 +01:00
Jakub Zelenka
e04ddb32c8
Merge branch 'PHP-8.3' 2023-09-08 11:00:14 +01:00
Jakub Zelenka
64ebadcac5
Fix GH-12151: str_getcsv ending with escape zero segfualt
Closes GH-12152
2023-09-08 10:58:55 +01:00
Ilija Tovilo
6fac4d0ff2
Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Skip leaking odbc test on asan
2023-09-08 11:08:27 +02:00
Ilija Tovilo
5ed58386d1
[skip ci] Skip leaking odbc test on asan 2023-09-08 11:05:34 +02:00
Remi Collet
c3c4b5356a
also display PHP version in phpize 2023-09-07 16:34:09 +02:00
Ilija Tovilo
c803402162
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix zend_separate_if_call_and_write for FUNC_ARGs
2023-09-07 14:26:31 +02:00
Ilija Tovilo
c2bb9bc0df
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix zend_separate_if_call_and_write for FUNC_ARGs
2023-09-07 14:26:09 +02:00
Ilija Tovilo
fa9cef8b47
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix zend_separate_if_call_and_write for FUNC_ARGs
2023-09-07 14:25:43 +02:00
Ilija Tovilo
748adf18fc
Fix zend_separate_if_call_and_write for FUNC_ARGs
Fixes GH-12102
Closees GH-12140
2023-09-07 14:25:11 +02:00
Ilija Tovilo
06c4092d05
Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert "Skip profiling of sqlite3_step"
2023-09-07 10:35:33 +02:00
Ilija Tovilo
3fb09940fc
Revert "Skip profiling of sqlite3_step"
This reverts commit bb31a75321.

It doesn't seem like this actually fixed the problem.
2023-09-07 10:35:06 +02:00
Máté Kocsis
2fad7cdd60
Fix type of the PHP_FLOAT_DIG constant
It used to be an int (https://github.com/php/php-src/pull/9616/files#diff-2978fe1c2c45b4eca89dc476376ddc7193bc4e5e7fff0c7d1c465f057b35a5e6L2155) before constant registration was refactored.
2023-09-07 10:01:02 +02:00
Máté Kocsis
2cb4d00693
Improve detection of predefined constants
In order to include constants documented at https://www.php.net/manual/en/reserved.constants.php, as well as constants which share the same varlistentry (just like what
https://www.php.net/manual/en/class.datetimeinterface.php#datetimeinterface.constants.atom does). In the same time, special constants like
true, false, null are excluded, since the manual uses their entity (&true;, &false, &null;, respectively), and gen_stub.php couldn't detect
them.
2023-09-07 10:00:55 +02:00
Niels Dossche
d693f0a4dc Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] UPGRADING
2023-09-06 18:02:07 +02:00
Niels Dossche
4ad5388b00 [ci skip] UPGRADING 2023-09-06 18:01:02 +02:00
George Peter Banyard
e72b6f471a Merge branch 'PHP-8.3'
* PHP-8.3:
  ODBC unit tests shouldn't override odbc.ini location
  Fix persistent procedural ODBC connections not getting closed
2023-09-06 01:58:30 +01:00
George Peter Banyard
e2667f17bc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ODBC unit tests shouldn't override odbc.ini location
  Fix persistent procedural ODBC connections not getting closed
2023-09-06 01:58:11 +01:00
George Peter Banyard
88ed678935 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ODBC unit tests shouldn't override odbc.ini location
  Fix persistent procedural ODBC connections not getting closed
2023-09-06 01:57:28 +01:00
Calvin Buckley
a648d39297 ODBC unit tests shouldn't override odbc.ini location
`ext/odbc/tests/config.inc` overrides the INIs used for the ODBC driver
manager pointlessly. It's not pointing to some custom PHP test suite
specific one, but the system one in `/etc/odbc(inst).ini`. Which
doesn't necessarily exist, on i.e. NixOS, MacPorts, etc.

Closes GH-12133

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-06 01:56:04 +01:00
Calvin Buckley
5a2b251610 Fix persistent procedural ODBC connections not getting closed
Like oci8, procedural ODBC uses an apply function on the hash list to
enumerate persistent connections and close the specific one. However,
this function take zvals, not resources. However, it was getting casted
as such, causing it to interpret the pointer incorrectly. This could
have caused other issues, but mostly manifested as failing to close the
connection even fi it matched.

The function now takes a zval and gets the resource from that. In
addition, it also removes the cast of the function pointer and moves
casting to the function body, to avoid possible confusion like this in
refactors again. It also cleans up style and uses constants in the
function body.

Closes GH-12132

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-09-06 01:55:02 +01:00
Dmitry Stogov
c69ec5402d Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix ws
2023-09-06 00:01:23 +03:00
Dmitry Stogov
3ffa1c4c3e Fix ws 2023-09-06 00:01:03 +03:00
Dmitry Stogov
ce80c7a73a Merge branch 'PHP-8.3'
* PHP-8.3:
  Fixed tracing jit for BIND_INIT_STATIC_OR_JMP
2023-09-05 23:58:23 +03:00
Dmitry Stogov
95edb50b58 Fixed tracing jit for BIND_INIT_STATIC_OR_JMP 2023-09-05 23:57:38 +03:00
Ilija Tovilo
fc1c948208
Merge branch 'PHP-8.3'
* PHP-8.3:
  Skip profiling of sqlite3_step
2023-09-05 17:38:25 +02:00
Ilija Tovilo
bb31a75321
Skip profiling of sqlite3_step
It looks like sqlite3_step can vary quite drastically from one request to the
next. This seems to be caused by more or fewer calls to sqlite3VdbeSorterWrite.
It would be great if we could find a way to make execution of this function more
consistent, but at this point I don't know how.

Closes GH-12130
2023-09-05 17:38:00 +02:00
Ilija Tovilo
fd13aeec95
Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert 479e659331
2023-09-05 16:14:59 +02:00