1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 01:23:53 +02:00
Commit Graph

4447 Commits

Author SHA1 Message Date
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
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
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
482ae71fda Fix memory leak 2022-10-31 12:20:28 +03: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
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
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
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
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
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
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
33918f999d Fixed warning 2022-09-19 13:12:49 +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
7e860eaef0 Don't throw CompileError after parsing
Aborting parsing is not safe, a fatal error is necessary.

See b9f7123c5e
2022-09-14 23:05:41 +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
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
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
Ilija Tovilo
d5373eac46 Fix lsp error in eval'd code referring to incorrect class for static type
Fixes GH-9407
Closes GH-9471
2022-09-08 10:52:27 +02: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
George Peter Banyard
b9f7123c5e Check at compile time that a built-in class is not being aliased (#9402)
If one tries to use such an alias as a type declaration the following error would be raised:
Fatal error: Cannot use 'int' as class name as it is reserved
2022-08-23 22:34:02 +01:00
Ollie Read
9b984f52ea Enum error message consistency (#9350) 2022-08-23 13:32:34 +02:00
Dmitry Stogov
a44fb09620 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix memory leaks
2022-08-22 17:54:36 +03:00
Dmitry Stogov
5bab9e94fd Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leaks
2022-08-22 17:47:43 +03:00
Dmitry Stogov
73c2d79fc5 Fix memory leaks
Fixes oss-fuzz #50078
2022-08-22 17:47:07 +03:00
Máté Kocsis
0897266219 Fix GH-9285 Traits cannot be used in readonly classes 2022-08-21 10:33:08 +02:00
twosee
7eba683e2c Fix unexpected deprecated dynamic property warning (#9324)
Occurred when exit() with uncaught exception in finally block.
2022-08-15 20:54:39 +08:00
Ilija Tovilo
1f6baa776b Show function name when dumping fake closure (#9306)
Fixes GH-8962
2022-08-12 12:22:55 +02:00
Christoph M. Becker
31a99331c1 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9266: GC root buffer keeps growing when dtors are present
2022-08-09 14:16:35 +02:00
Michael Olšavský
0709578517 Fix GH-9266: GC root buffer keeps growing when dtors are present
Do not reset cleared count on GC rerun.

Closes GH-9265.
2022-08-09 14:16:11 +02:00
Tyson Andre
6a50af2604 Make "{$g{'h'}}" emit fatal error and no incorrect deprecation notice in 8.2 (#9264)
The ast node flag constants ZEND_DIM_ALTERNATIVE_SYNTAX and
ZEND_ENCAPS_VAR_DOLLAR_CURLY_VAR_VAR node have identical values (1<<1),
causing a deprecation notice to be incorrectly emitted before the fatal error
for unsupported syntax.

Fixes GH-9263

Explicitly check for AST_VAR/AST_DIM kind for future compatibility

`AST_PROP`/`AST_METHOD_CALL` and nullsafe variants can also be found in
encapsulated strings - currently they have no flags but they may have flags in
the future. This also clarifies that this deprecation warning can only happen
for AST_VAR/AST_DIM nodes for certain `attr` values.
2022-08-08 19:41:32 -04:00
sji
3b62d66098 Implement constants in traits (#8888)
RFC: https://wiki.php.net/rfc/constants_in_traits
2022-08-04 20:08:40 +01:00
Ilija Tovilo
3663f7661a DIM on null in const expr should emit warning 2022-08-04 11:24:16 +02:00
Ilija Tovilo
7b43d819c8 Also fix ?-> on magic consts in const expressions
Fixes GH-9136
Fixes GH-9138
2022-08-03 23:40:06 +02:00
Ilija Tovilo
f957e3e7f1 Fix arrow function with never return type
Fixes GH-7900
Closes GH-9103
2022-07-29 12:25:09 +02:00
Ilija Tovilo
966d22b1bd Fix property fetch on magic constants in constant expressions
Closes GH-9136
Closes GH-9138
Closes GH-9172
2022-07-28 14:14:11 +02:00
Martin Schröder
0adbf9c2d4 Fix memory leak in fiber constructor by throwing an error (#9098) 2022-07-22 10:47:47 -05:00
George Peter Banyard
4457dba1fb Add support for stubs to declare intersection type class properties (#8751) 2022-07-22 13:04:49 +01:00
Ilija Tovilo
7aadbcb8f4 GH-8344 Fetch properties of enums in const expressions 2022-07-18 23:52:28 +02:00
Aaron Piotrowski
2bc6025c2c Prevent fiber switching in tick function and signal handlers (#9028) 2022-07-16 13:05:16 -05:00
Arnaud Le Blanc
4552941219 Merge branch 'PHP-8.1'
* PHP-8.1:
  [ci skip] NEWS
  Fix `WeakMap` object reference offset causing `TypeError` (#8995)
2022-07-15 13:19:12 +02:00