Commit graph

62702 commits

Author SHA1 Message Date
George Peter Banyard
1ad59b32c2 Update INI validator and displayers depending on INI type
Closes GH-9451
2022-09-06 10:33:34 +01:00
Tim Düsterhus
ddf7a5d4d9
random: Validate that the arrays do not contain extra elements when unserializing (#9458)
* Apply `var_dump()` in 02_engine/all_serialize_error.phpt

This ensures that an undetected serialization error is clear identifiable in the output.

* random: Validate that the arrays do not contain extra elements when unserializing
2022-09-05 17:33:36 +02:00
Christoph M. Becker
15405c60da
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9411: PgSQL large object resource is incorrectly closed
2022-09-05 17:28:23 +02:00
Christoph M. Becker
b5cad508fe
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9411: PgSQL large object resource is incorrectly closed
2022-09-05 17:26:13 +02:00
Yurun
6ac3f7c84d
Fix GH-9411: PgSQL large object resource is incorrectly closed
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-9411.
2022-09-05 16:37:54 +02:00
Máté Kocsis
c547fc183c
Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
Máté Kocsis
87862578cb
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix inexistent skipif.inc
2022-09-05 12:38:09 +02:00
Máté Kocsis
59180b50b3
Fix inexistent skipif.inc 2022-09-05 12:37:53 +02:00
Dmitry Stogov
c151e9b75b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix type inference
2022-09-05 13:01:04 +03:00
Dmitry Stogov
c852e0fff9 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference
2022-09-05 12:56:34 +03:00
Dmitry Stogov
81cb005ef7 Fix type inference
Fixes oss-fuzz #50792
2022-09-05 12:55:50 +03:00
David Bohman
f098193d15 GH-9464: Fix build on older macOs releases.
A simple check for CommonCrypto/CommonRandom.h does not work on earlier macOS.
Must also pull in sys/types.h for size_t, Availability.h for __OSX_AVAILABLE_STARTING,
and CommonCrypto/CommonCryptoError.h for CCCryptorStatus.

Closes GH-9479.
2022-09-04 02:12:28 +01:00
Arnaud Le Blanc
ea1287b015
Log the cause of error when opcache cannot write to file cache (#9258) 2022-09-03 11:23:43 +02:00
Arnaud Le Blanc
fb242f41ba
Fix high opcache.interned_strings_buffer causing shm corruption (#9260) 2022-09-03 11:23:10 +02:00
Máté Kocsis
e733ebf30e
Add parenthesis around preprocessor conditions in stubs
gen_stub.php concatenates nested #ifs into one #if so let's make sure the semantics remain the same.
2022-09-02 16:21:28 +02:00
Máté Kocsis
cfa72ff3af
Declare ext/standard constants in stubs - part 6
Closes GH-9467
2022-09-02 16:07:25 +02:00
Máté Kocsis
5c3559464b
Fix memory leak triggered by unsuccessful dynamic property unserialization
Closes GH-9468
2022-09-02 15:07:19 +02:00
Máté Kocsis
6f2f228e4a
Declare ext/standard constants in stubs - part 5
Closes GH-9466
2022-09-02 15:04:49 +02:00
Arnaud Le Blanc
dcde9b85a6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  [ci skip] NEWS
  Add tests
  Fix GH-8932: Provide a way to get the called-scope of closures (#9299)
2022-09-02 13:55:57 +02:00
Arnaud Le Blanc
409baac29c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] NEWS
  Add tests
  Fix GH-8932: Provide a way to get the called-scope of closures (#9299)
2022-09-02 13:53:14 +02:00
Arnaud Le Blanc
db1ef97209 Add tests 2022-09-02 13:33:21 +02:00
Nicolas Grekas
93f11d8429
Fix GH-8932: Provide a way to get the called-scope of closures (#9299)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-09-02 13:32:50 +02:00
Máté Kocsis
64b962b241
Declare ext/standard constants in stubs - part 4
Closes GH-9465
2022-09-02 12:41:51 +02:00
Ilija Tovilo
d36874d002
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix class name FQN when AST dumping new and class const
2022-09-02 08:58:27 +02:00
Ilija Tovilo
2cfb028e22
Fix class name FQN when AST dumping new and class const
Fixes GH-9447
Closes GH-9462
2022-09-02 08:57:26 +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
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
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
Tim Düsterhus
c77bbf6fe5
Mark crypt()'s $string parameter as #[\SensitiveParameter] 2022-08-30 20:02:28 +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
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
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
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
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
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
Dmitry Stogov
218da70bcf Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix memory leak
2022-08-29 14:54:49 +03:00
Dmitry Stogov
172ac0a48d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak
2022-08-29 14:54:40 +03:00
Dmitry Stogov
4135e6011c Fix memory leak
Fixes oss-fuzz #50616
2022-08-29 14:53:48 +03:00
Dmitry Stogov
4b884bedc8 JIT: Fix missing type store
Fixes oss-fuzz #50653
2022-08-29 14:36:16 +03:00
Christoph M. Becker
725cb4e8ad
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-29 12:41:36 +02:00
Dmitry Stogov
2f9bc6e37a Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix ext/opcache/tests/jit/inc_obj_004.phpt failure introduced by fd74ee7e90
2022-08-29 12:36:06 +03:00