1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 05:51:02 +02:00
Commit Graph

129559 Commits

Author SHA1 Message Date
Tim Düsterhus
3db5fa4008 Merge branch 'PHP-8.2'
* PHP-8.2:
  Unify structure for ext/random's randomizer tests (#9410)
2022-08-31 19:23:06 +02:00
Tim Düsterhus
f7d426cca6 Unify structure for ext/random's randomizer tests (#9410)
* Unify structure for ext/random's engine tests (2)

This makes adjustments that were missed in
2d6a883b3a.

* Add `engines.inc` for ext/random tests

* Unify structure for ext/random's randomizer tests
2022-08-31 19:22:39 +02:00
Bob Weinand
1e1ea4fbb7 Merge remote-tracking branch 'origin/PHP-8.2' 2022-08-31 16:59:23 +02:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Bob Weinand
800c6672e5 Fix compilation on MacOS
memrchr has an always available equivalent under the name of zend_memrchr.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Bob Weinand
9e6eab3c13 Store default object handlers alongside the class entry
Object handlers being separate from class entries is a legacy inherited from PHP 5. Today it has little benefit to keep them separate: in fact, accessing object handlers usually requires not-so-safe hacks.
While it is possible to swap handlers in a custom installed create_object handler, this mostly is tedious, as well as it requires allocating the object handlers struct at runtime, possibly caching it etc..

This allows extensions, which intend to observe other classes to install their own class handlers.
The life cycle of internal classes may now be simply observed by swapping the class handlers in post_startup stage.
The life cycle of userland classes may be observed by iterating over the new classes in zend_compile_file and zend_compile_string and then swapping their handlers.

In general, this would also be a first step in directly tying the object handlers to classes. Especially given that I am not aware of any case where the object handlers would be different between various instances of a given class.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Christoph M. Becker
e5c7b5b578 [ci skip] Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix pcre.jit on Apple Silicon
2022-08-31 14:24:53 +02:00
Christoph M. Becker
807fe37ae9 [ci skip] Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix pcre.jit on Apple Silicon
2022-08-31 14:24:22 +02:00
Niklas Keller
f8b217a345 Fix pcre.jit on Apple Silicon
This backports https://github.com/zherczeg/sljit/pull/105. Relates to bug #80435, however, it doesn't solve the bus error on PHP 8.0, but PHP 8.1 builds fine now.

Closes GH-9279.
2022-08-31 14:22:44 +02:00
Ben Ramsey
1553334f7a Merge branch 'PHP-8.2' 2022-08-30 13:07:29 -05:00
Ben Ramsey
8330a0f323 Add PHP-8.2 branch to build processes 2022-08-30 13:07:16 -05:00
Tim Düsterhus
3fdce9fce4 Merge branch 'PHP-8.2'
* PHP-8.2:
  Mark crypt()'s $string parameter as #[\SensitiveParameter]
  Prepare NEWS for PHP 8.2.0RC2
2022-08-30 20:03:17 +02:00
Tim Düsterhus
c77bbf6fe5 Mark crypt()'s $string parameter as #[\SensitiveParameter] 2022-08-30 20:02:28 +02:00
Ben Ramsey
06f713e80f Add PHP-8.2 branch to build processes 2022-08-30 11:42:59 -05:00
Pierrick Charron
9f303cf7d3 Prepare NEWS for PHP 8.2.0RC2 2022-08-30 12:10:40 -04:00
Alex
1d45ca58c8 Harden GitHub Workflows security
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>

Closes GH-9440.
2022-08-30 17:59:58 +02:00
Pierrick Charron
a1b23be6bf Merge branch 'PHP-8.2'
* PHP-8.2:
  Prepare PHP 8.2.0 RC1
2022-08-30 11:58:59 -04:00
Pierrick Charron
58a92772ab Prepare PHP 8.2.0 RC1 2022-08-30 11:57:05 -04:00
Pierrick Charron
327c95237c Prepare for PHP 8.3 2022-08-30 11:17:15 -04:00
Christoph M. Becker
853181a14d Add NEWS and UPGRADING entries for GH-9296 2022-08-30 16:59:39 +02:00
Christoph M. Becker
90a49712fe [ci skip] Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix tests
2022-08-30 16:53:42 +02:00
Christoph M. Becker
65619e868c Fix tests
These changes have been overlooked, when 7908aae30c
had been reverted.
2022-08-30 16:52:33 +02:00
Ben Ramsey
fbc46e3114 Merge branch 'PHP-8.1' 2022-08-30 09:18:12 -05:00
Ben Ramsey
1862152145 Revert "Fix GH-9296: ksort behaves incorrectly on arrays with mixed keys"
This reverts commit cd1aed8edd, as
discussed on internals (<https://externals.io/message/118483>).
2022-08-30 09:13:46 -05:00
Tyson Andre
8b9679e88e Make var_export/debug_zval_dump check for infinite recursion on the *object* (#9448)
Switch the recursion check from the result of `get_properties_for`
(the returned hash table of properties) to just checking for
infinite recursion on the object.

- In order for a native datastructure to correctly implement
  `*get_properties_for` for var_export's cycle detection,
  it would need to return the exact same array every time prior to this PR.

  Prior to this commit, the requirements for cycle detection
  would prevent SplFixedArray or similar classes from returning a
  temporary array that:

  1. Wouldn't be affected by unexpected mutations from error handlers
  2. Could be garbage collected instead.
2022-08-30 09:19:45 -04:00
Sara Golemon
a05add6938 Merge branch 'PHP-8.1'
* PHP-8.1:
  Catch up dev version numbers
2022-08-30 12:16:42 +00:00
Sara Golemon
8be917b248 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Catch up dev version numbers
2022-08-30 12:16:25 +00:00
Sara Golemon
3d6ed8c852 Catch up dev version numbers 2022-08-30 12:15:27 +00:00
Máté Kocsis
adb45a63c0 Fix GH-9186 @strict-properties can be bypassed using unserialization (#9354)
* Emit deprecation warnings when adding dynamic properties to classes during unserialization - this will become an Error in php 9.0.
  (Adding dynamic properties in other contexts was already a deprecation warning - the use case of unserialization was overlooked)
* Throw an error when attempting to add a dynamic property to a `readonly` class when unserializing
* Add new serialization methods `__serialize`/`__unserialize` for SplFixedArray to avoid creating deprecated dynamic
  properties that would then be added to the backing fixed-size array
* Don't add named dynamic/declared properties (e.g. $obj->foo) of SplFixedArray to the backing array when unserializing
* Update tests to declare properties or to expect the deprecation warning
* Add news entry

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
2022-08-30 07:46:32 -04:00
Máté Kocsis
8d78dce902 Remove unused ext/zend_test alias functions 2022-08-30 11:57:29 +02:00
Máté Kocsis
869ab3c481 Adjust PHPDoc 2022-08-30 11:56:29 +02:00
Máté Kocsis
ef21bbe66c Fix zend/test aliases 2022-08-30 11:48:12 +02:00
Andreas Braun
f7d42f646b Update gen_stub to avoid compile errors on duplicate function names
Closes GH-9406
2022-08-30 11:33:45 +02:00
Jakub Zelenka
e3034dba3e Fix FPM tester conflict 2022-08-29 22:45:04 +01:00
Jakub Zelenka
f3c357c446 Merge branch 'PHP-8.1' 2022-08-29 22:34:48 +01:00
Jakub Zelenka
bf97b3649d Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 22:33:02 +01:00
Jakub Zelenka
3503b1daa2 Fix bug #77780: "Headers already sent" when previous connection was aborted
This change primarily splits SAPI deactivation to module and destroy
parts. The reason is that currently some SAPIs might bail out
on deactivation. One of those SAPI is PHP-FPM that can bail out on
request end if for example the connection is closed by the client
(web sever). The problem is that in such case the resources are not
freed and some values reset. The most visible impact can have not
resetting the PG(headers_sent) which can cause erorrs in the next
request. One such issue is described in #77780 bug which this fixes
and is also cover by a test in this commit. It seems reasonable
to separate deactivation and destroying of the resource which means
that the bail out will not impact it.
2022-08-29 22:25:53 +01:00
Calvin Buckley
f3a14d1b1a Fix GH-9347: Current ODBC liveness checks may be inadequate
We implement SQL_ATTR_CONNECTION_DEAD for ODBC and PDO_ODBC.

This is semantically appropriate and should be used whenever the
driver supports it. In the event that it fails or says the connection
isn't dead (which may be inaccurate in some cases), try the old
heuristic.

Closes GH-9353.
2022-08-29 18:32:31 +02:00
Jakub Zelenka
15bca2956b Merge branch 'PHP-8.1' 2022-08-29 16:43:26 +01:00
Jakub Zelenka
7dc3d4b510 Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 16:42:58 +01:00
Jakub Zelenka
986e7319c5 Re-add fixed tests for GH-8885 2022-08-29 16:42:10 +01:00
Jakub Zelenka
36063873b0 Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 16:41:19 +01:00
Jakub Zelenka
bcdd9877e1 Fix GH-8885 tests on MacOS 2022-08-29 16:40:31 +01:00
Dmitry Stogov
a55441615c Merge branch 'PHP-8.1'
* PHP-8.1:
  typo
2022-08-29 17:13:23 +03:00
Dmitry Stogov
4845d7026a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  typo
2022-08-29 17:13:16 +03:00
Dmitry Stogov
263a07e5b0 typo 2022-08-29 17:12:57 +03:00
Jakub Zelenka
869ccf17f6 Merge branch 'PHP-8.1' 2022-08-29 14:41:55 +01:00
Jakub Zelenka
be45f540ee Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 14:40:57 +01:00
Dmitry Menshikov
f92505cf24 Fix GH-8885: access.log with stderr writes logs to error_log after reload
This fix allows restoring the the original stderr so the logs are
correctly written.
2022-08-29 14:39:24 +01:00
Derick Rethans
932586c426 Fixed bug GH-9431: DateTime::getLastErrors() not returning false when no errors/warnings
For PHP 8.2 and later only.
2022-08-29 14:33:41 +01:00