1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 17:43:13 +02:00
Commit Graph

17906 Commits

Author SHA1 Message Date
Sergey Panteleev
e02aeaf0b0 Update versions for PHP 8.2.0RC4 2022-10-11 10:45:57 +03: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
74ae498a4b Move object/class redundancy check into union type handling
As such a redundancy can only happen for union types
2022-09-30 12:48:56 +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
94b8c2da9f Fixed type inference
Fixes oss-fuzz #51640
2022-09-26 12:19:12 +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
Patrick Allaert
18cd80c327 Fixed undefined macros warnings 2022-09-22 13:17:02 +02:00
Dmitry Stogov
7496a400aa Fix SSA construction and type inference
Fixes oss-fuzz #51476
2022-09-19 15:45:34 +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
fe0eaf107a Fix UB pointer arithmetics on NULL
Closes GH-9559
2022-09-16 18:24:39 +02: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
Bob Weinand
5a0b68bed7 Revert "Store default object handlers alongside the class entry"
This reverts commit 9e6eab3c13.

Reverted along a01dd9feda.
2022-09-14 11:18:14 +02:00
Bob Weinand
a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
Sara Golemon
559da529a0 Bump for 8.0.25 2022-09-13 23:46:26 +00:00
Patrick Allaert
0f575aa698 PHP-8.1 is now for PHP 8.1.12-dev 2022-09-13 23:09:47 +02:00
George Peter Banyard
5bfceae770 Only check classes in intersection type if the type might be valid
Closes GH-9522
2022-09-13 11:10:32 +01:00
Ilija Tovilo
09aa27cc09 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix ZEND_RC_MOD_CHECK() for thread local ini parser strings
2022-09-12 23:33:03 +02:00
Ilija Tovilo
9af98cd465 Fix ZEND_RC_MOD_CHECK() for thread local ini parser strings 2022-09-12 23:31:26 +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
6c4d24e4f0 Update cache slot size calculation in compact_literals.c 2022-09-10 13:20:59 +01:00
George Peter Banyard
c70a8281e3 Use DNF intersection type check also for simple intersection types 2022-09-10 11:39:22 +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
George Peter Banyard
80315edd58 Introduce PROGRESS_CACHE_SLOT() macro 2022-09-10 11:34:11 +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
George Peter Banyard
3e362f51ac Add zend_string INI validators
Currently we only have validators for char* which is rather annoying as INI settings are saved as zend_string* in the first place

Closes GH-9328
2022-09-06 10:41:47 +01: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
Máté Kocsis
5210872747 Regenerate optimizer func info after preprocessor condition changes 2022-09-02 17:18:42 +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
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
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
Pierrick Charron
58a92772ab Prepare PHP 8.2.0 RC1 2022-08-30 11:57:05 -04: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
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
Bob Weinand
8fe1db2089 Delay fiber VM stack cleanup until after observer has been called
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-29 12:17:12 +02:00
Tim Starling
11796229f2 Add libxml_get_external_entity_loader()
Add libxml_get_external_entity_loader(), which returns the currently
installed external entity loader, i.e. the value which was passed to
libxml_set_external_entity_loader() or null if no loader was installed
and the default entity loader will be used.

This allows libraries to save and restore the loader, controlling entity
expansion without interfering with the rest of the application.

Add macro Z_PARAM_FUNC_OR_NULL_WITH_ZVAL(). This allows us to get the
zval for a callable parameter without duplicating callable argument
parsing.

The saved zval keeps the object needed for fcc/fci alive, simplifying
memory management.

Fixes #76763.
2022-08-28 12:47:20 +01:00
Jakub Zelenka
505e8d2a04 Fix GH-9310: SSL local_cert and local_pk do not respect open_basedir restriction 2022-08-28 12:11:14 +01:00
Máté Kocsis
b4ec3e9bc0 Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02: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