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

4470 Commits

Author SHA1 Message Date
Ilija Tovilo adfdfb2e1e Improvements in modifier parsing (#9926)
Use a shared non-terminal for all class modifiers. This avoids conflicts when
adding modifiers that are only valid for certain targets. This change is
necessary for asymmetric visibility but might be useful for other future
additions.

Closes GH-9926
2022-11-17 16:20:27 +01:00
Ilija Tovilo 8731fb2d09 Fix caching of default params with side-effects
Fixes GH-9965
Closes GH-9935
2022-11-17 11:52:12 +01:00
Tim Düsterhus dd8de1e726 Promote unserialize() notices to warning (#9629)
* Unserialize: Migrate "Unexpected end of serialized data" to E_WARNING

* Unserialize: Migrate "Error at offset %d of %d bytes" to E_WARNING

* Unserialize: Migrate "%s is returned from __sleep() multiple times" to E_WARNING

* Add NEWS for “Promote unserialize() notices to warning”
2022-11-15 19:36:38 +01:00
Dmitry Stogov 08f9b50a9c Merge branch 'PHP-8.2'
* PHP-8.2:
  Don't check "fake" closures (fix assertion)
2022-11-07 12:21:03 +03:00
Dmitry Stogov 05b63b1593 Don't check "fake" closures (fix assertion)
Fixes oss-fuzz #53078
2022-11-07 12:19:54 +03:00
Arnaud Le Blanc 02ed12240e Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  [ci skip] NEWS
  Fix generator memory leaks when interrupted during argument evaluation (#9756)
2022-11-04 16:06:42 +01:00
Arnaud Le Blanc 34a85fbea0 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix generator memory leaks when interrupted during argument evaluation (#9756)
2022-11-04 16:02:04 +01:00
Arnaud Le Blanc 4011657719 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] NEWS
  Fix generator memory leaks when interrupted during argument evaluation (#9756)
2022-11-04 15:59:14 +01:00
Arnaud Le Blanc 5d1f3e047c Fix generator memory leaks when interrupted during argument evaluation (#9756) 2022-11-04 15:55:55 +01:00
Ilija Tovilo a9231e7fb2 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix fake closure leaking when called from internal func
2022-11-03 14:32:22 +01:00
Ilija Tovilo cc9dddea38 Fix fake closure leaking when called from internal func
Introduced in 8e49d7f32f.

ZEND_CALL_RELEASE_THIS was previously not handled for internal calls but
just for user calls in the zend_leave_helper.

Closes GH-9884
2022-11-03 14:31:47 +01:00
Dmitry Stogov fd6d2ccfcb Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix memory leak
2022-10-31 12:22:40 +03:00
Dmitry Stogov 482ae71fda Fix memory leak 2022-10-31 12:20:28 +03:00
Tyson Andre c4ecd82f93 Make inspecting SplFixedArray instances more memory efficient/consistent, change print_r null props handling (#9757)
* Make handling of SplFixedArray properties more consistent

Create a brand new reference counted array every time in SplFixedArray
to be freed by the callers (or return null).
Switch from overriding `get_properties` to overriding `get_properties_for` handler

* Print objects with null hash table like others in print_r

Noticed when working on subsequent commits for SplFixedArray.
Make whether zend_get_properties_for returns null or an empty array
invisible to the end user - it would be always be a non-null array for
user-defined classes.
Always print newlines with `\n\s*(\n\s*)` after objects

Noticed when working on SplFixedArray changes, e.g. in
ext/spl/tests/SplFixedArray__construct_param_null.phpt
2022-10-24 08:33:25 -04:00
Arnaud Le Blanc 77eadc5c9f Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  [ci skip] NEWS
  Fix compilation warning
  Fix crash when memory limit is exceeded during generator initialization
2022-10-22 10:45:21 +02:00
Arnaud Le Blanc cfd5fb98e4 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix compilation warning
  Fix crash when memory limit is exceeded during generator initialization
2022-10-22 10:44:55 +02:00
Arnaud Le Blanc ebe58459aa Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] NEWS
  Fix compilation warning
  Fix crash when memory limit is exceeded during generator initialization
2022-10-22 10:44:06 +02:00
Arnaud Le Blanc 26c7c82d32 Fix crash when memory limit is exceeded during generator initialization 2022-10-22 10:40:28 +02:00
Arnaud Le Blanc 1c1481bbb5 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  [ci skip] NEWS
  Restore extra_named_params when restoring frozen call stack
2022-10-16 12:48:26 +02:00
Arnaud Le Blanc a1295cbfce Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  [ci skip] NEWS
  Restore extra_named_params when restoring frozen call stack
2022-10-16 12:45:41 +02:00
Arnaud Le Blanc 2831e0c624 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] NEWS
  Restore extra_named_params when restoring frozen call stack
2022-10-16 12:43:34 +02:00
Arnaud Le Blanc 86e1fea39a Restore extra_named_params when restoring frozen call stack 2022-10-16 12:40:09 +02:00
George Peter Banyard a593a456f1 Merge branch 'PHP-8.2'
* PHP-8.2:
  Follow-up fix for GH-9655
2022-10-04 14:25:57 +01:00
George Peter Banyard 01eb06a0de Follow-up fix for GH-9655
Type needs to be rendered as a DNF type and not X&Y|null
2022-10-04 14:24:51 +01:00
Tim Starling b8811d4ff1 Add four extra fields to gc_status() (#9336)
- running: true if garbage collection is currently running
- protected: true if the garbage collector is protected and root
  additions are forbidden
- full: true if the garbage collector buffer size exceeds GC_MAX_BUF_SIZE
- buffer_size: current garbage collector buffer size

Documentation for existing fields:

- runs: the number of times the garbage collector has been run
- collected: the number of objects collected
- threshold: the number of roots in the buffer which will trigger
  garbage collection
- roots: the current number of roots in the buffer

Updated manual example output:

array(8) {
  ["running"]=>
  bool(false)
  ["protected"]=>
  bool(false)
  ["full"]=>
  bool(false)
  ["runs"]=>
  int(5)
  ["collected"]=>
  int(100002)
  ["threshold"]=>
  int(50001)
  ["buffer_size"]=>
  int(131072)
  ["roots"]=>
  int(0)
}
2022-10-04 13:56:02 +01:00
George Peter Banyard 8f63cc7b8b Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9655: Allow pure intersection types to be implicitly nullable
2022-10-03 11:03:31 +01:00
HypeMC 279ffdb598 Fix GH-9655: Allow pure intersection types to be implicitly nullable
Closes GH-9659
2022-10-03 11:02:52 +01:00
George Peter Banyard bb79ef775b Fix GH-9556 "iterable" alias "array|Traversable" breaks PHP 8.1 code
Closes GH-9558
2022-09-30 12:50:45 +01:00
George Peter Banyard c801076d8b Fix GH-9556 "iterable" alias "array|Traversable" breaks PHP 8.1 code
Closes GH-9558
2022-09-30 12:49:15 +01:00
George Peter Banyard 0f8b9eb49b Add support for binary and octal number prefixes for INI settings
Closes GH-9560
2022-09-30 11:58:36 +01:00
George Peter Banyard 0d19ae4068 Add support for binary and octal number prefixes for INI settings
Closes GH-9560
2022-09-30 11:56:39 +01:00
Dmitry Stogov 90db4c741e Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix memory leak
2022-09-26 11:47:41 +03:00
Dmitry Stogov 5ad8b3bcfa Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak
2022-09-26 11:47:32 +03:00
Dmitry Stogov b20568d4fa Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak
2022-09-26 11:44:38 +03:00
Dmitry Stogov 8258b7731b Fix memory leak
Fixes oss-fuzz #51622
2022-09-26 11:43:38 +03:00
Dmitry Stogov 31dca2ecec Merge branch 'PHP-8.2'
* PHP-8.2:
  Fixed warning
2022-09-19 13:13:04 +03:00
Dmitry Stogov 33918f999d Fixed warning 2022-09-19 13:12:49 +03:00
Dmitry Stogov 7fdf896d4b Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix memory leak
2022-09-19 13:04:18 +03:00
Dmitry Stogov c0d49b7c7d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak
2022-09-19 13:04:09 +03:00
Dmitry Stogov 8a1f7fa721 Fix memory leak
Fixes oss-fuzz #51451
2022-09-19 13:03:24 +03:00
Ilija Tovilo 743d3780c6 Add clang ASAN/UBSAN push job
Closes GH-9507
2022-09-14 23:55:46 +02:00
Ilija Tovilo ed202b2a50 Merge branch 'PHP-8.2'
* PHP-8.2:
  Don't throw CompileError after parsing
2022-09-14 23:06:05 +02:00
Ilija Tovilo 7e860eaef0 Don't throw CompileError after parsing
Aborting parsing is not safe, a fatal error is necessary.

See https://github.com/php/php-src/commit/b9f7123c5e4ccdc3c381ab949ff01e3c14f3465c
2022-09-14 23:05:41 +02:00
Ilija Tovilo 0771ef8b85 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix syntax error when dnf type in parens after readonly
2022-09-11 12:30:25 +02:00
Ilija Tovilo 08b7539583 Fix syntax error when dnf type in parens after readonly
Fixes GH-9500
Closes GH-9512
2022-09-11 12:29:29 +02:00
George Peter Banyard fbbada1f81 Merge branch 'PHP-8.2' 2022-09-10 11:41:25 +01:00
George Peter Banyard 9286101da4 Fix GH-9516: (A&B)|D as a param should allow AB or D. Not just A.
The issue was that we didn't compute enough cache slots for DNF types.
Nor progressed throught the CE's in the cache slot, meaning we were only checking if the value passed
satisfied the first type of the nested intersection type.
2022-09-10 11:34:32 +01:00
Ilija Tovilo 4842edeae4 Improve magic __get and property type inconsistency error message
Fixes GH-9388
Closes GH-9436
2022-09-08 11:07:29 +02:00
Ilija Tovilo 580c29e1a2 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix lsp error in eval'd code referring to incorrect class for static type
2022-09-08 10:54:02 +02:00
Ilija Tovilo 15ee9d2686 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix lsp error in eval'd code referring to incorrect class for static type
2022-09-08 10:53:45 +02:00